shithub: freetype+ttf2subf

Download patch

ref: 4f7851e3d24ccbddcfeda28357d00517b5dec022
parent: e9f0cdb6c0f44edcebc3ceb9d102f48f4aebd055
author: Werner Lemberg <[email protected]>
date: Sun Jun 27 09:03:54 EDT 2010

[cff] Fix memory leak.

* src/cff/cffgload.c (cff_operator_seac): Free charstrings even in
case of errors.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2010-06-27  Werner Lemberg  <[email protected]>
 
+	[cff] Fix memory leak.
+
+	* src/cff/cffgload.c (cff_operator_seac): Free charstrings even in
+	case of errors.
+
+2010-06-27  Werner Lemberg  <[email protected]>
+
 	[cff] Protect against invalid `hintmask' and `cntrmask' operators.
 
 	* src/cff/cffgload.c (cff_decoder_parse_charstrings)
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -811,10 +811,10 @@
                                              charstring_len );
       decoder->seac = FALSE;
 
+      cff_free_glyph_data( face, &charstring, charstring_len );
+
       if ( error )
         goto Exit;
-
-      cff_free_glyph_data( face, &charstring, charstring_len );
     }
 
     /* Save the left bearing, advance and glyph width of the base */
@@ -841,10 +841,10 @@
                                              charstring_len );
       decoder->seac = FALSE;
 
+      cff_free_glyph_data( face, &charstring, charstring_len );
+
       if ( error )
         goto Exit;
-
-      cff_free_glyph_data( face, &charstring, charstring_len );
     }
 
     /* Restore the left side bearing, advance and glyph width */