From: Takeshi Abe Date: Sun, 1 Nov 2009 05:04:35 +0000 (+0000) Subject: Fixed a possible memory leak in case that FT_Glyph_To_Bitmap() fails X-Git-Tag: php-5.2.12RC1~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=494877cbd120ede4b901c782b18f0c51f4fefed6;p=php Fixed a possible memory leak in case that FT_Glyph_To_Bitmap() fails --- diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c index ffac3ebf6b..ac2bf344ff 100644 --- a/ext/gd/libgd/gdft.c +++ b/ext/gd/libgd/gdft.c @@ -1090,6 +1090,7 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi if (render) { if (image->format != ft_glyph_format_bitmap && FT_Glyph_To_Bitmap(&image, ft_render_mode_normal, 0, 1)) { + FT_Done_Glyph(image); if (tmpstr) { gdFree(tmpstr); }