From: Cristy Date: Sun, 6 May 2018 16:56:57 +0000 (-0400) Subject: https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=33970 X-Git-Tag: 7.0.7-31~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e20ed0590f5fc7dc4021d3a524cbb93bd3a0fb1;p=imagemagick https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=33970 --- 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); \