Skip to content

Commit f595a19

Browse files
author
Cristy
committed
https://github.com/ImageMagick/ImageMagick/issues/1589
1 parent d08250e commit f595a19

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Diff for: MagickCore/annotate.c

+11-2
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,11 @@ MagickExport MagickBooleanType AnnotateImage(Image *image,
274274
number_lines++;
275275
textlist=AcquireQuantumMemory(number_lines+1,sizeof(*textlist));
276276
if (textlist == (char **) NULL)
277-
return(MagickFalse);
277+
{
278+
annotate_info=DestroyDrawInfo(annotate_info);
279+
annotate=DestroyDrawInfo(annotate);
280+
return(MagickFalse);
281+
}
278282
p=text;
279283
for (i=0; i < number_lines; i++)
280284
{
@@ -303,7 +307,12 @@ MagickExport MagickBooleanType AnnotateImage(Image *image,
303307
(void) ParseGeometry(annotate_info->geometry,&geometry_info);
304308
}
305309
if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
306-
return(MagickFalse);
310+
{
311+
annotate_info=DestroyDrawInfo(annotate_info);
312+
annotate=DestroyDrawInfo(annotate);
313+
textlist=(char **) RelinquishMagickMemory(textlist);
314+
return(MagickFalse);
315+
}
307316
if (IsGrayColorspace(image->colorspace) != MagickFalse)
308317
(void) SetImageColorspace(image,sRGBColorspace,exception);
309318
status=MagickTrue;

0 commit comments

Comments
 (0)