]> granicus.if.org Git - imagemagick/commitdiff
Fixed memory leak.
authorDirk Lemstra <dirk@git.imagemagick.org>
Sun, 18 Feb 2018 11:33:23 +0000 (12:33 +0100)
committerDirk Lemstra <dirk@git.imagemagick.org>
Sun, 18 Feb 2018 11:33:23 +0000 (12:33 +0100)
coders/psd.c

index fffef82946a36f012858e5468b32977261697adb..ccbd10ad52564cfbceb599e7655aed42c4ca92bf 100644 (file)
@@ -2280,7 +2280,11 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception)
     If we are only "pinging" the image, then we're done - so return.
   */
   if (EOFBlob(image) != MagickFalse)
-    ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile");
+    {
+      if (profile != (StringInfo *) NULL)
+        profile=DestroyStringInfo(profile);
+      ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile");
+    }
   if (image_info->ping != MagickFalse)
     {
       (void) CloseBlob(image);