From: erg Date: Wed, 14 May 2008 21:28:50 +0000 (+0000) Subject: Fix space leak in libgd output X-Git-Tag: LAST_LIBGRAPH~32^2~4069 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d6f265d15c095796d50c33d78ac8f91c573d0e6;p=graphviz Fix space leak in libgd output --- 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 */