shithub: freetype+ttf2subf

Download patch

ref: 4a15013a2988206cb126d6bc550e06f975439a13
parent: d8fc009dbbab054164166b7dd643d5d72c9269c3
author: Werner Lemberg <[email protected]>
date: Wed Nov 25 02:53:49 EST 2015

* src/bdf/bdflib.c (bdf_load_font): Fix small memory leak (#46480).

(_bdf_parse_glyphs): Always reset `p->glyph_name' after moving its
contents.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-11-25  Werner Lemberg  <[email protected]>
+
+	* src/bdf/bdflib.c (bdf_load_font): Fix small memory leak (#46480).
+
+	(_bdf_parse_glyphs): Always reset `p->glyph_name' after moving its
+	contents.
+
 2015-11-21  Werner Lemberg  <[email protected]>
 
 	* include/freetype/internal/ftcalc.h: Don't use `register' keyword.
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -1790,6 +1790,9 @@
           glyph           = font->unencoded + font->unencoded_used;
           glyph->name     = p->glyph_name;
           glyph->encoding = (long)font->unencoded_used++;
+
+          /* Reset the initial glyph info. */
+          p->glyph_name = NULL;
         }
         else
         {
@@ -2589,6 +2592,7 @@
 
       memory = extmemory;
 
+      FT_FREE( p->glyph_name );
       FT_FREE( p );
     }
 
@@ -2600,7 +2604,6 @@
     memory = extmemory;
 
     FT_FREE( p->font );
-    FT_FREE( p->glyph_name );
 
     goto Exit;
   }