From f584527205c9a1f5430f85c3cef51ed95f375737 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sun, 18 Feb 2018 12:33:23 +0100 Subject: [PATCH] Fixed memory leak. --- coders/psd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- 2.40.0