From: kramm Date: Sun, 6 Apr 2008 16:51:24 +0000 (+0000) Subject: fixed two mem leaks X-Git-Tag: buttons-working~259 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=dded149e9730fb089e8238872b2d117f0eaf7454;p=swftools.git fixed two mem leaks --- diff --git a/lib/gfxpoly.c b/lib/gfxpoly.c index 90c178e..6392f53 100644 --- a/lib/gfxpoly.c +++ b/lib/gfxpoly.c @@ -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); } diff --git a/lib/pdf/GFXOutputDev.cc b/lib/pdf/GFXOutputDev.cc index a61aebc..8ee24b4 100644 --- a/lib/pdf/GFXOutputDev.cc +++ b/lib/pdf/GFXOutputDev.cc @@ -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 */