]> granicus.if.org Git - graphviz/commitdiff
Fix space leak in libgd output
authorerg <devnull@localhost>
Wed, 14 May 2008 21:28:50 +0000 (21:28 +0000)
committererg <devnull@localhost>
Wed, 14 May 2008 21:28:50 +0000 (21:28 +0000)
plugin/gd/gvtextlayout_gd.c

index c3fc86f9099f3a19f58b1c659c26ea4844482107..df22f9bd6e6c2dd580385520a2c19d1bf7fbb532 100644 (file)
@@ -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 */