From 8e20ed0590f5fc7dc4021d3a524cbb93bd3a0fb1 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 6 May 2018 12:56:57 -0400 Subject: [PATCH] https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=33970 --- MagickCore/property.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/MagickCore/property.c b/MagickCore/property.c index ccf3d6452..9c441ffc8 100644 --- a/MagickCore/property.c +++ b/MagickCore/property.c @@ -3347,7 +3347,13 @@ DisableMSCWarning(4127) \ interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \ MaxTextExtent,sizeof(*interpret_text)); \ if (interpret_text == (char *) NULL) \ - return((char *) NULL); \ + { \ + if (property_image != image) \ + property_image=DestroyImage(property_image); \ + if (property_info != image_info) \ + property_info=DestroyImageInfo(property_info); \ + return((char *) NULL); \ + } \ q=interpret_text+strlen(interpret_text); \ } \ } \ @@ -3363,7 +3369,13 @@ DisableMSCWarning(4127) \ interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \ MaxTextExtent,sizeof(*interpret_text)); \ if (interpret_text == (char *) NULL) \ - return((char *) NULL); \ + { \ + if (property_image != image) \ + property_image=DestroyImage(property_image); \ + if (property_info != image_info) \ + property_info=DestroyImageInfo(property_info); \ + return((char *) NULL); \ + } \ q=interpret_text+strlen(interpret_text); \ } \ q+=FormatLocaleString(q,extent,"%s=%s\n",(key),(value)); \ @@ -3380,7 +3392,13 @@ DisableMSCWarning(4127) \ interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \ MaxTextExtent,sizeof(*interpret_text)); \ if (interpret_text == (char *) NULL) \ - return((char *) NULL); \ + { \ + if (property_image != image) \ + property_image=DestroyImage(property_image); \ + if (property_info != image_info) \ + property_info=DestroyImageInfo(property_info); \ + return((char *) NULL); \ + } \ q=interpret_text+strlen(interpret_text); \ } \ (void) CopyMagickString(q,(string),extent); \ -- 2.50.1