From: Cristy Date: Thu, 10 Aug 2017 20:33:13 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/667 X-Git-Tag: 7.0.6-6~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=061d0fa25f432be51e75e3f7db9d2da1cce14d2f;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/667 --- diff --git a/coders/png.c b/coders/png.c index ff7037759..0c1e0838f 100644 --- a/coders/png.c +++ b/coders/png.c @@ -13086,7 +13086,10 @@ static MagickBooleanType WriteOneJNGImage(MngInfo *mng_info, jpeg_image=CloneImage(image,0,0,MagickTrue,exception); if (jpeg_image == (Image *) NULL) - ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); + { + jpeg_image_info=DestroyImageInfo(jpeg_image_info); + ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); + } (void) CopyMagickString(jpeg_image->magick,"JPEG",MagickPathExtent); (void) AcquireUniqueFilename(jpeg_image->filename);