]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/667
authorCristy <urban-warrior@imagemagick.org>
Thu, 10 Aug 2017 20:33:13 +0000 (16:33 -0400)
committerCristy <urban-warrior@imagemagick.org>
Thu, 10 Aug 2017 20:33:13 +0000 (16:33 -0400)
coders/png.c

index ff70377598e2f264aac84ec366129161322a6a64..0c1e0838fc6a6dc03c16001fdadb273b650a573a 100644 (file)
@@ -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);