[cff] Fix memory leak. * src/cff/cffgload.c (cff_operator_seac): Free charstrings even in case of errors.
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 38 39 40 41 42 43 44 45 46 47
diff --git a/ChangeLog b/ChangeLog
index 63dc3f3..ff4b71d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2010-06-27 Werner Lemberg <wl@gnu.org>
+ [cff] Fix memory leak.
+
+ * src/cff/cffgload.c (cff_operator_seac): Free charstrings even in
+ case of errors.
+
+2010-06-27 Werner Lemberg <wl@gnu.org>
+
[cff] Protect against invalid `hintmask' and `cntrmask' operators.
* src/cff/cffgload.c (cff_decoder_parse_charstrings)
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 51efcb9..e77e280 100644
--- 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 */