From fc77478b683386f3ea26c2f87e0880532e38d133 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 24 Mar 2018 12:51:13 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/1045 --- coders/fits.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/coders/fits.c b/coders/fits.c index 51a01469b..fd2e31c63 100644 --- a/coders/fits.c +++ b/coders/fits.c @@ -669,7 +669,10 @@ static MagickBooleanType WriteFITSImage(const ImageInfo *image_info, image->endian=MSBEndian; quantum_info=AcquireQuantumInfo(image_info,image); if (quantum_info == (QuantumInfo *) NULL) - ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); + { + fits_info=DestroyString(fits_info); + ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); + } offset=0; (void) FormatLocaleString(header,FITSBlocksize, "SIMPLE = T"); -- 2.40.0