From: Cristy Date: Sat, 24 Mar 2018 16:46:58 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/1049 X-Git-Tag: 7.0.7-28~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df8a62fe4938aa41a39e815937c58bc0ed21b664;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/1049 --- diff --git a/coders/pcx.c b/coders/pcx.c index 880565874..7fead1dc5 100644 --- a/coders/pcx.c +++ b/coders/pcx.c @@ -998,7 +998,11 @@ static MagickBooleanType WritePCXImage(const ImageInfo *image_info,Image *image, pcx_colormap=(unsigned char *) AcquireQuantumMemory(256UL, 3*sizeof(*pcx_colormap)); if (pcx_colormap == (unsigned char *) NULL) - ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); + { + if (page_table != (MagickOffsetType *) NULL) + page_table=(MagickOffsetType *) RelinquishMagickMemory(page_table); + ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); + } (void) memset(pcx_colormap,0,3*256*sizeof(*pcx_colormap)); q=pcx_colormap; if ((image->storage_class == PseudoClass) && (image->colors <= 256))