From: Cristy Date: Sun, 30 Jul 2017 10:03:57 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/631 X-Git-Tag: 7.0.6-5~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb713211bad3fa4f0c535255fa043917482fc964;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/631 --- diff --git a/coders/xpm.c b/coders/xpm.c index 26c71be1a..2734c1ff5 100644 --- a/coders/xpm.c +++ b/coders/xpm.c @@ -690,7 +690,13 @@ static MagickBooleanType WritePICONImage(const ImageInfo *image_info, (void) RelinquishUniqueFileResource(blob_info->filename); blob_info=DestroyImageInfo(blob_info); if ((picon == (Image *) NULL) || (affinity_image == (Image *) NULL)) - return(MagickFalse); + { + if (affinity_image != (Image *) NULL) + affinity_image=DestroyImage(affinity_image); + if (picon != (Image *) NULL) + picon=DestroyImage(picon); + return(MagickFalse); + } quantize_info=AcquireQuantizeInfo(image_info); status=RemapImage(quantize_info,picon,affinity_image,exception); quantize_info=DestroyQuantizeInfo(quantize_info);