From: Dirk Lemstra Date: Sat, 28 Apr 2018 10:31:04 +0000 (+0200) Subject: Fixed memory leak (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7961). X-Git-Tag: 7.0.7-29~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac28e5143cd1f9e8337a2a0c6830df87a43addef;p=imagemagick Fixed memory leak (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7961). --- diff --git a/coders/rle.c b/coders/rle.c index 3da2a395f..583593a6c 100644 --- a/coders/rle.c +++ b/coders/rle.c @@ -318,7 +318,10 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowRLEException(ResourceLimitError,"MemoryAllocationFailed"); count=ReadBlob(image,length-1,(unsigned char *) comment); if (count != (length-1)) - ThrowRLEException(CorruptImageError,"UnexpectedEndOfFile"); + { + comment=DestroyString(comment); + ThrowRLEException(CorruptImageError,"UnexpectedEndOfFile"); + } comment[length-1]='\0'; (void) SetImageProperty(image,"comment",comment,exception); comment=DestroyString(comment);