From ac28e5143cd1f9e8337a2a0c6830df87a43addef Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sat, 28 Apr 2018 12:31:04 +0200 Subject: [PATCH] Fixed memory leak (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7961). --- coders/rle.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 2.40.0