[truetype] Fix memory leak for broken GX fonts (#46188). * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix scope of deallocation.
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
diff --git a/ChangeLog b/ChangeLog
index 73a717b..96e45a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2015-10-13 Werner Lemberg <wl@gnu.org>
+ [truetype] Fix memory leak for broken GX fonts (#46188).
+
+ * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix scope of
+ deallocation.
+
+2015-10-13 Werner Lemberg <wl@gnu.org>
+
[truetype] Fix commit from 2015-10-10.
* src/truetype/ttgxvar.c (ft_var_load_gvar): Add missing error
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 31954e2..2f11504 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -2059,8 +2059,6 @@
if ( localpoints != ALL_POINTS )
FT_FREE( localpoints );
- if ( sharedpoints != ALL_POINTS )
- FT_FREE( sharedpoints );
FT_FREE( deltas_x );
FT_FREE( deltas_y );
@@ -2072,6 +2070,8 @@
FT_TRACE5(( "\n" ));
Fail2:
+ if ( sharedpoints != ALL_POINTS )
+ FT_FREE( sharedpoints );
FT_FREE( tuple_coords );
FT_FREE( im_start_coords );
FT_FREE( im_end_coords );