From: Cristy Date: Tue, 1 Aug 2017 11:05:17 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/636 X-Git-Tag: 7.0.6-5~14^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e793eb203e5e0f91f5037aed6585e81b1e27395b;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/636 --- diff --git a/ChangeLog b/ChangeLog index 23bf6513d..f4000b0b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2017-07-01 7.0.6-5 Cristy + * Fixed numerous memory leaks (reference + https://github.com/ImageMagick/ImageMagick/issues). + 2017-07-29 7.0.6-5 Glenn Randers-Pehrson * Properly set image->colorspace in the PNG decoder (previously it was setting image->gamma, but only setting image->colorspace diff --git a/coders/msl.c b/coders/msl.c index 911119f24..26067052c 100644 --- a/coders/msl.c +++ b/coders/msl.c @@ -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);