From: Dirk Lemstra Date: Mon, 17 Jul 2017 21:13:50 +0000 (+0200) Subject: Fix another leak related to #574. X-Git-Tag: 7.0.6-2~18^2~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b604a554dfb6630fe32e739334fa57341dc6123;p=imagemagick Fix another leak related to #574. --- diff --git a/MagickCore/quantize.c b/MagickCore/quantize.c index 851a24015..5281ee2c4 100644 --- a/MagickCore/quantize.c +++ b/MagickCore/quantize.c @@ -3395,8 +3395,11 @@ static MagickBooleanType SetGrayscaleImage(Image *image, IntensityCompare); colormap=(PixelInfo *) AcquireQuantumMemory(image->colors,sizeof(*colormap)); if (colormap == (PixelInfo *) NULL) - ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", - image->filename); + { + colormap_index=(ssize_t *) RelinquishMagickMemory(colormap_index); + ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", + image->filename); + } j=0; colormap[j]=image->colormap[0]; for (i=0; i < (ssize_t) image->colors; i++)