Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > media > main-updates-src > by-pkgid > a6c468d5fa3408dbd88ed90cd40665e9 > files > 5

freetype2-2.3.12-1.9mdv2010.2.src.rpm

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