* src/bdf/bdfdrivr.c (bdf_interpret_style, BDF_Face_Done): Fix small memory leak.
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
diff --git a/ChangeLog b/ChangeLog
index 32ff89e..5c7b381 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-21 Håvard Wall <haavardw@ifi.uio.no>
+
+ * src/bdf/bdfdrivr.c (bdf_interpret_style, BDF_Face_Done): Fix small
+ memory leak.
+
2005-11-21 Werner Lemberg <wl@gnu.org>
* src/sfnt/ttload.c (sfnt_init): Add tracing message.
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index e14306e..20f8554 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -248,7 +248,10 @@ THE SOFTWARE.
}
if ( !parts || !len )
- face->style_name = (char *)"Regular";
+ {
+ FT_ALLOC( face->style_name, ft_strlen( "Regular" ) + 1 );
+ ft_strcpy( face->style_name, "Regular" );
+ }
else
{
char *style, *s;
@@ -311,6 +314,7 @@ THE SOFTWARE.
FT_FREE( face->charset_encoding );
FT_FREE( face->charset_registry );
FT_FREE( bdfface->family_name );
+ FT_FREE( bdfface->style_name );
FT_FREE( bdfface->available_sizes );