From 7ce5774d6d17a11225399fc9428b7448a930ff03 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Mon, 8 Jul 2019 22:43:54 +0200 Subject: [PATCH] Fixed memory leak. --- MagickCore/annotate.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MagickCore/annotate.c b/MagickCore/annotate.c index 397fdd571..eaf6b8224 100644 --- a/MagickCore/annotate.c +++ b/MagickCore/annotate.c @@ -1765,10 +1765,10 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info, metrics->origin.y=(double) origin.y; if (metrics->origin.x > metrics->width) metrics->width=metrics->origin.x; - if (last_glyph.image != 0) + if (last_glyph.image != (FT_Glyph) NULL) { FT_Done_Glyph(last_glyph.image); - last_glyph.image=0; + last_glyph.image=(FT_Glyph) NULL; } last_glyph=glyph; code=GetUTFCode(p+grapheme[i].cluster); @@ -1777,10 +1777,10 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info, grapheme=(GraphemeInfo *) RelinquishMagickMemory(grapheme); if (utf8 != (unsigned char *) NULL) utf8=(unsigned char *) RelinquishMagickMemory(utf8); - if (glyph.image != 0) + if (last_glyph.image != (FT_Glyph) NULL) { - FT_Done_Glyph(glyph.image); - glyph.image=0; + FT_Done_Glyph(last_glyph.image); + last_glyph.image=(FT_Glyph) NULL; } /* Determine font metrics. -- 2.40.0