vcl/generic/glyphs/gcach_ftyp.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 9ab800829b8a0e44824dc11276b54b1870bc5b2b
Author: Mark Wielaard <m...@klomp.org>
Date:   Sun Jun 30 17:08:56 2013 +0200

    Fix memory leak in ServerFont::GetGlyphOutline.
    
    Always call FT_Done_Glyph before returning.
    
    Change-Id: I861bcc66b065d9cfb909b3ea561af97caccc4593
    Reviewed-on: https://gerrit.libreoffice.org/4635
    Reviewed-by: Khaled Hosny <khaledho...@eglug.org>
    Tested-by: Khaled Hosny <khaledho...@eglug.org>

diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx 
b/vcl/generic/glyphs/gcach_ftyp.cxx
index d75c7d2..29c8820 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -2179,7 +2179,10 @@ bool ServerFont::GetGlyphOutline( int nGlyphIndex,
         return false;
 
     if( pGlyphFT->format != FT_GLYPH_FORMAT_OUTLINE )
+    {
+        FT_Done_Glyph( pGlyphFT );
         return false;
+    }
 
     if( mbArtItalic )
     {
@@ -2191,7 +2194,10 @@ bool ServerFont::GetGlyphOutline( int nGlyphIndex,
 
     FT_Outline& rOutline = 
reinterpret_cast<FT_OutlineGlyphRec*>(pGlyphFT)->outline;
     if( !rOutline.n_points )    // blank glyphs are ok
+    {
+        FT_Done_Glyph( pGlyphFT );
         return true;
+    }
 
     long nMaxPoints = 1 + rOutline.n_points * 3;
     PolyPolygon aToolPolyPolygon;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to