summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-02-07 17:21:39 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-02-09 10:15:48 +0000
commit603cb6cf31a5212d03736a552770e5734b0e8066 (patch)
tree10950b1224e274873120ea0908152b7f3503b969 /vcl/source
parent5b426038a7befcaf0d05824ffb20200ff8833ad3 (diff)
fix mem leak
Change-Id: I0d329357ac282d4652b0f7ebc401cbd51963461b
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/fontsubset/sft.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 81184aaf9d75..f216c34622fb 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1476,8 +1476,10 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
}
t->ntables = GetUInt16(t->ptr + tdoffset, 4);
- if( t->ntables >= 128 )
+ if (t->ntables >= 128) {
+ CloseTTFont(t);
return SF_TTFORMAT;
+ }
t->tables = static_cast<const sal_uInt8**>(calloc(NUM_TAGS, sizeof(sal_uInt8 *)));
assert(t->tables != nullptr);