From 3d6f265d15c095796d50c33d78ac8f91c573d0e6 Mon Sep 17 00:00:00 2001 From: erg Date: Wed, 14 May 2008 21:28:50 +0000 Subject: [PATCH] Fix space leak in libgd output --- plugin/gd/gvtextlayout_gd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin/gd/gvtextlayout_gd.c b/plugin/gd/gvtextlayout_gd.c index c3fc86f90..df22f9bd6 100644 --- a/plugin/gd/gvtextlayout_gd.c +++ b/plugin/gd/gvtextlayout_gd.c @@ -110,6 +110,7 @@ static boolean gd_textlayout(textpara_t * para, char **fontpath) gdFTStringExtra strex; double fontsize; + strex.fontpath = NULL; strex.flags = gdFTEX_RETURNFONTPATHNAME | gdFTEX_RESOLUTION; strex.hdpi = strex.vdpi = POINTS_PER_INCH; @@ -156,6 +157,8 @@ static boolean gd_textlayout(textpara_t * para, char **fontpath) if (fontpath) *fontpath = strex.fontpath; + else + free (strex.fontpath); /* strup'ed in libgd */ if (para->str && para->str[0]) { /* can't use brect on some archtectures if strlen 0 */ -- 2.50.1