From 603cb6cf31a5212d03736a552770e5734b0e8066 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 7 Feb 2018 17:21:39 +0000 Subject: fix mem leak Change-Id: I0d329357ac282d4652b0f7ebc401cbd51963461b --- vcl/source/fontsubset/sft.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'vcl') 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(calloc(NUM_TAGS, sizeof(sal_uInt8 *))); assert(t->tables != nullptr); -- cgit v1.2.3