]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/636
authorCristy <urban-warrior@imagemagick.org>
Tue, 1 Aug 2017 11:05:17 +0000 (07:05 -0400)
committerCristy <urban-warrior@imagemagick.org>
Tue, 1 Aug 2017 11:05:17 +0000 (07:05 -0400)
ChangeLog
coders/msl.c

index 23bf6513d6b7c9299e69b6b0323f3457b7ec1fda..f4000b0b29fd9ebe95196d1610e884033d6456df 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-07-01  7.0.6-5 Cristy  <quetzlzacatenango@image...>
+  * Fixed numerous memory leaks (reference
+    https://github.com/ImageMagick/ImageMagick/issues).
+
 2017-07-29  7.0.6-5 Glenn Randers-Pehrson <glennrp@image...>
   * Properly set image->colorspace in the PNG decoder (previously
     it was setting image->gamma, but only setting image->colorspace
index 911119f24e7ed6283fbf4e4847123d66b6d7cb9f..26067052c183891ce13d10fed94a8247367567b5 100644 (file)
@@ -7899,12 +7899,25 @@ static MagickBooleanType ProcessMSLScript(const ImageInfo *image_info,
   }
   if (msl_info.exception->severity == UndefinedException)
     (void) xmlParseChunk(msl_info.parser," ",1,MagickTrue);
+  /*
+    Free resources.
+  */
   xmlFreeParserCtxt(msl_info.parser);
   (void) LogMagickEvent(CoderEvent,GetMagickModule(),"end SAX");
   msl_info.group_info=(MSLGroupInfo *) RelinquishMagickMemory(
     msl_info.group_info);
   if (*image == (Image *) NULL)
     *image=(*msl_info.image);
+  *msl_info.image_info=DestroyImageInfo(*msl_info.image_info);
+  msl_info.image_info=(ImageInfo **) RelinquishMagickMemory(
+    msl_info.image_info);
+  *msl_info.draw_info=DestroyDrawInfo(*msl_info.draw_info);
+  msl_info.draw_info=(DrawInfo **) RelinquishMagickMemory(msl_info.draw_info);
+  msl_info.image=(Image **) RelinquishMagickMemory(msl_info.image);
+  *msl_info.attributes=DestroyImage(*msl_info.attributes);
+  msl_info.attributes=(Image **) RelinquishMagickMemory(msl_info.attributes);
+  msl_info.group_info=(MSLGroupInfo *) RelinquishMagickMemory(
+    msl_info.group_info);
   if (msl_info.exception->severity != UndefinedException)
     return(MagickFalse);
   return(MagickTrue);