From: Cristy Date: Mon, 22 Jan 2018 13:00:02 +0000 (-0500) Subject: Eliminate small memory leak X-Git-Tag: 7.0.7-22~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c4b013e159205cb4849240e9773984cf90e0a913;p=imagemagick Eliminate small memory leak Credit OSS Fuzz --- 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)