From: Alex Gaynor Date: Fri, 27 Apr 2018 20:26:36 +0000 (-0400) Subject: Fixed memory leak in heif X-Git-Tag: 7.0.7-29~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb005622e2827836baaf5efc2239326b8c44060e;p=imagemagick Fixed memory leak in heif --- diff --git a/coders/heic.c b/coders/heic.c index 8fa660782..f84811585 100644 --- a/coders/heic.c +++ b/coders/heic.c @@ -191,7 +191,10 @@ static Image *ReadHEICImage(const ImageInfo *image_info, error=heif_context_read_from_memory(heif_context,file_data,length,NULL); file_data=RelinquishMagickMemory(file_data); if (error.code != 0) - ThrowReaderException(CorruptImageError,"UnableToReadImageData"); + { + heif_context_free(heif_context); + ThrowReaderException(CorruptImageError,"UnableToReadImageData"); + } image_handle=(struct heif_image_handle *) NULL; error=heif_context_get_primary_image_handle(heif_context,&image_handle); if (error.code != 0)