diff -Naurp freetype-2.3.11/src/bdf/bdflib.c freetype-2.3.11.oden/src/bdf/bdflib.c --- freetype-2.3.11/src/bdf/bdflib.c 2009-09-12 17:14:25.000000000 -0400 +++ freetype-2.3.11.oden/src/bdf/bdflib.c 2010-08-22 06:28:30.000000000 -0400 @@ -470,6 +470,11 @@ } + /* An empty string for empty fields. */ + + static const char empty[1] = { 0 }; /* XXX eliminate this */ + + static char * _bdf_list_join( _bdf_list_t* list, int c, @@ -494,18 +499,14 @@ if ( i + 1 < list->used ) dp[j++] = (char)c; } - dp[j] = 0; + if ( dp != empty ) + dp[j] = 0; *alen = j; return dp; } - /* An empty string for empty fields. */ - - static const char empty[1] = { 0 }; /* XXX eliminate this */ - - static FT_Error _bdf_list_split( _bdf_list_t* list, char* separators, @@ -1867,6 +1868,9 @@ error = BDF_Err_Invalid_File_Format; Exit: + if ( error && ( p->flags & _BDF_GLYPH ) ) + FT_FREE( p->glyph_name ); + return error; }