]> granicus.if.org Git - imagemagick/commitdiff
Fixed memory leak.
authorjinyong.choi <jinyong.choi@cdnetworks.com>
Thu, 5 Apr 2018 05:36:54 +0000 (14:36 +0900)
committerDirk Lemstra <dlemstra@users.noreply.github.com>
Thu, 5 Apr 2018 09:38:41 +0000 (11:38 +0200)
Destory profile memory after using.

coders/jp2.c

index 4efe99d99545fc084505964f0479c5565d4b663c..a793e1f6c97f1e802bab81befbe305bbf4a32893 100644 (file)
@@ -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)
     {