From: Dirk Lemstra Date: Sun, 18 Feb 2018 11:33:23 +0000 (+0100) Subject: Fixed memory leak. X-Git-Tag: 7.0.7-23~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f584527205c9a1f5430f85c3cef51ed95f375737;p=imagemagick Fixed memory leak. --- diff --git a/coders/psd.c b/coders/psd.c index fffef8294..ccbd10ad5 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -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);