From: Cristy Date: Sun, 16 Jun 2019 02:02:18 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/1589 X-Git-Tag: 7.0.8-50~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f595a1985233c399a05c0c37cc41de16a90dd025;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/1589 --- diff --git a/MagickCore/annotate.c b/MagickCore/annotate.c index a1145780a..494720211 100644 --- a/MagickCore/annotate.c +++ b/MagickCore/annotate.c @@ -274,7 +274,11 @@ MagickExport MagickBooleanType AnnotateImage(Image *image, number_lines++; textlist=AcquireQuantumMemory(number_lines+1,sizeof(*textlist)); if (textlist == (char **) NULL) - return(MagickFalse); + { + annotate_info=DestroyDrawInfo(annotate_info); + annotate=DestroyDrawInfo(annotate); + return(MagickFalse); + } p=text; for (i=0; i < number_lines; i++) { @@ -303,7 +307,12 @@ MagickExport MagickBooleanType AnnotateImage(Image *image, (void) ParseGeometry(annotate_info->geometry,&geometry_info); } if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse) - return(MagickFalse); + { + annotate_info=DestroyDrawInfo(annotate_info); + annotate=DestroyDrawInfo(annotate); + textlist=(char **) RelinquishMagickMemory(textlist); + return(MagickFalse); + } if (IsGrayColorspace(image->colorspace) != MagickFalse) (void) SetImageColorspace(image,sRGBColorspace,exception); status=MagickTrue;