Commit 9249cabf1 for imagemagick.org
commit 9249cabf1a131eb74c138145afd1452cb62873f8
Author: Cristy <urban-warrior@imagemagick.org>
Date: Wed Sep 9 08:53:59 2026 -0400
https://github.com/ImageMagick/ImageMagick/issues/8949
diff --git a/MagickCore/constitute.c b/MagickCore/constitute.c
index e218688db..2993213a5 100644
--- a/MagickCore/constitute.c
+++ b/MagickCore/constitute.c
@@ -1196,7 +1196,11 @@ MagickExport Image *ReadInlineImage(const ImageInfo *image_info,
(void *) NULL);
*read_info->filename='\0';
if (GetImplicitDataImageType(content,read_info->magick,exception) == MagickFalse)
- ThrowReaderException(ImageError,"ImageTypeNotSupported");
+ {
+ blob=(unsigned char *) RelinquishMagickMemory(blob);
+ read_info=DestroyImageInfo(read_info);
+ ThrowReaderException(ImageError,"ImageTypeNotSupported");
+ }
image=BlobToImage(read_info,blob,length,exception);
blob=(unsigned char *) RelinquishMagickMemory(blob);
read_info=DestroyImageInfo(read_info);