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

(_bdf_parse_glyphs): Always reset `p->glyph_name' after moving its
contents.
This commit is contained in:
Werner Lemberg 2015-11-25 07:53:49 +01:00
parent d8fc009dbb
commit 4a15013a29
2 changed files with 11 additions and 1 deletions

View File

@ -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.

View File

@ -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;
}