From: root <356986351@qq.com> Date: Fri, 15 Sep 2017 16:40:18 +0000 (+0000) Subject: fix memory leak in hrz X-Git-Tag: 7.0.7-3~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=31ff6d90f604310c823363fd051871e3eebe47e9;p=imagemagick fix memory leak in hrz --- diff --git a/coders/hrz.c b/coders/hrz.c index 948c04ac0..19236b82e 100644 --- a/coders/hrz.c +++ b/coders/hrz.c @@ -154,7 +154,10 @@ static Image *ReadHRZImage(const ImageInfo *image_info,ExceptionInfo *exception) { count=ReadBlob(image,length,pixels); if ((size_t) count != length) - ThrowReaderException(CorruptImageError,"UnableToReadImageData"); + { + pixels=(unsigned char *) RelinquishMagickMemory(pixels); + ThrowReaderException(CorruptImageError,"UnableToReadImageData"); + } p=pixels; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL)