* src/bdf/bdflib.c (bdf_load_font): Fix small memory leak (#46480). (_bdf_parse_glyphs): Always reset `p->glyph_name' after moving its contents.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
diff --git a/ChangeLog b/ChangeLog
index bd5f2bb..42451d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-11-25 Werner Lemberg <wl@gnu.org>
+
+ * 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 <wl@gnu.org>
* include/freetype/internal/ftcalc.h: Don't use `register' keyword.
diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c
index d1d1704..7b40f42 100644
--- 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;
}