From: jinyong.choi Date: Thu, 5 Apr 2018 05:36:54 +0000 (+0900) Subject: Fixed memory leak. X-Git-Tag: 7.0.7-29~191 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e3572db31f5e41a3b95583e71851132f5cf20ab;p=imagemagick Fixed memory leak. Destory profile memory after using. --- diff --git a/coders/jp2.c b/coders/jp2.c index 4efe99d99..a793e1f6c 100644 --- a/coders/jp2.c +++ b/coders/jp2.c @@ -425,7 +425,10 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception) profile=BlobToStringInfo(jp2_image->icc_profile_buf, jp2_image->icc_profile_len); if (profile != (StringInfo *) NULL) - SetImageProfile(image,"icc",profile,exception); + { + SetImageProfile(image,"icc",profile,exception); + profile=DestroyStringInfo(profile); + } } if (image->ping != MagickFalse) {