fixed two mem leaks
authorkramm <kramm>
Sun, 6 Apr 2008 16:51:24 +0000 (16:51 +0000)
committerkramm <kramm>
Sun, 6 Apr 2008 16:51:24 +0000 (16:51 +0000)
lib/gfxpoly.c
lib/pdf/GFXOutputDev.cc

index 90c178e..6392f53 100644 (file)
@@ -327,7 +327,7 @@ gfxpoly_t* gfxpoly_fillToPoly(gfxline_t*line)
        return (gfxpoly_t*)gfxpoly_strokeToPoly(0, 0, gfx_capButt, gfx_joinMiter, 0);
     }
     ArtSVP* svp2 = art_svp_rewind_uncrossed(art_svp_uncross(svp),ART_WIND_RULE_ODDEVEN);
-    free(svp);svp=svp2;
+    art_svp_free(svp);svp=svp2;
     return (gfxpoly_t*)svp;
 }
 
@@ -407,5 +407,5 @@ gfxpoly_t* gfxpoly_createbox(double x1, double y1,double x2, double y2)
 void gfxpoly_free(gfxpoly_t*poly)
 {
     ArtSVP*svp = (ArtSVP*)poly;
-    free(svp);
+    art_svp_free(svp);
 }
index a61aebc..8ee24b4 100644 (file)
@@ -1812,14 +1812,14 @@ void GFXOutputDev::updateStrokeColor(GfxState *state)
 }
 
 
-gfxfont_t* createGfxFont(GfxFont*xpdffont, FontInfo*src, double config_fontquality)
+static gfxfont_t* createGfxFont(GfxFont*xpdffont, FontInfo*src, double config_fontquality)
 {
     gfxfont_t*font = (gfxfont_t*)malloc(sizeof(gfxfont_t));
     memset(font, 0, sizeof(gfxfont_t));
 
     font->glyphs = (gfxglyph_t*)malloc(sizeof(gfxglyph_t)*src->num_glyphs);
     memset(font->glyphs, 0, sizeof(gfxglyph_t)*src->num_glyphs);
-    font->id = strdup(getFontID(xpdffont));
+    font->id = 0;
     int t;
     
     double quality = (INTERNAL_FONT_SIZE * 200 / config_fontquality) / src->max_size;
@@ -2661,7 +2661,7 @@ void GFXOutputDev::clearSoftMask(GfxState *state)
     }
   
     gfxresult_t*mask = states[statepos].softmaskrecording;
-    gfxresult_t*below = this->device->finish(this->device);
+    gfxresult_t*below = this->device->finish(this->device);free(this->device);
     this->device = states[statepos].olddevice;
 
     /* get outline of all objects below the soft mask */