* src/cid/cidgload.c (cid_load_glyph): Fix memory leak. Reported by Kostya Serebryany <kcc@google.com>.
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
diff --git a/ChangeLog b/ChangeLog
index 7525c10..09ba4b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2015-10-17 Werner Lemberg <wl@gnu.org>
+ * src/cid/cidgload.c (cid_load_glyph): Fix memory leak.
+
+ Reported by Kostya Serebryany <kcc@google.com>.
+
+2015-10-17 Werner Lemberg <wl@gnu.org>
+
[bdf] Prevent memory leak (#46217).
* src/bdf/bdflib.c (_bdf_parse_glyphs) <STARTCHAR>: Check
diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c
index 2c0f0ec..1fbf23d 100644
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -167,8 +167,6 @@
glyph_length - cs_offset );
}
- FT_FREE( charstring );
-
#ifdef FT_CONFIG_OPTION_INCREMENTAL
/* Incremental fonts can optionally override the metrics. */
@@ -193,6 +191,8 @@
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
Exit:
+ FT_FREE( charstring );
+
return error;
}