From c4b013e159205cb4849240e9773984cf90e0a913 Mon Sep 17 00:00:00 2001 From: Cristy Date: Mon, 22 Jan 2018 08:00:02 -0500 Subject: [PATCH] Eliminate small memory leak Credit OSS Fuzz --- coders/dcm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coders/dcm.c b/coders/dcm.c index 0f93262a5..29fa651f5 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -3555,6 +3555,8 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) break; colors=(size_t) (length/info.bytes_per_pixel); datum=(int) colors; + if (graymap != (int *) NULL) + graymap=(int *) RelinquishMagickMemory(graymap); graymap=(int *) AcquireQuantumMemory((size_t) colors, sizeof(*graymap)); if (graymap == (int *) NULL) -- 2.40.0