File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments