fixed mem leak
authorkramm <kramm>
Fri, 26 Oct 2007 14:39:05 +0000 (14:39 +0000)
committerkramm <kramm>
Fri, 26 Oct 2007 14:39:05 +0000 (14:39 +0000)
lib/pdf/GFXOutputDev.cc

index e40b60d..a1ddba9 100644 (file)
@@ -1559,7 +1559,8 @@ void GFXOutputDev::updateFont(GfxState *state)
     gfxfont_t*font = gfxfontlist_findfont(this->gfxfontlist,id);
     if(!font) {
        font = createGfxFont(gfxFont, current_fontinfo);
-       gfxfontlist_addfont(this->gfxfontlist, font);
+        font->id = strdup(id);
+       this->gfxfontlist = gfxfontlist_addfont(this->gfxfontlist, font);
        device->addfont(device, font);
     }
     current_gfxfont = font;