summaryrefslogtreecommitdiff
path: root/src/cff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2020-06-18 13:46:37 +0800
committerWerner Lemberg <wl@gnu.org>2020-06-19 03:37:32 +0200
commitc8cd139c3025f6371974c8aecfe3a393dd5ad994 (patch)
treef11bbec8f0943751fcea966f2df5604d6443451e /src/cff
parent7438235b42e9d425888c68519d1e05dd2b69fff7 (diff)
downloadfreetype2-c8cd139c3025f6371974c8aecfe3a393dd5ad994.tar.gz
[cff] Free table upon error allocating other data (#58609).
* src/cff/cffload.c (cff_index_get_pointers): When new_bytes fails to allocate, make sure to free the table. Do the same for both allocations if there is a later error.
Diffstat (limited to 'src/cff')
-rw-r--r--src/cff/cffload.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index 3a3df6b0f..13f499269 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -489,6 +489,10 @@
}
Exit:
+ if ( error && new_bytes )
+ FT_FREE( new_bytes );
+ if ( error && t )
+ FT_FREE( t );
return error;
}