From dec31185926422affd06ccc63b54c5bfe4a5d637 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Mon, 6 Mar 2023 22:41:17 -0500 Subject: [PATCH] * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Triage memory leak. This leak has been introduced in the previous commit and immediately detected: https://chromium-review.googlesource.com/c/chromium/src/+/4313202 --- src/truetype/ttgload.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 52f8ea8bc..cca81b41c 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -453,6 +453,8 @@ /* and thus allocate the bytecode array size by ourselves */ if ( n_ins ) { + if ( exec->glyphSize ) + FT_FREE( exec->glyphIns ); if ( FT_QNEW_ARRAY( exec->glyphIns, n_ins ) ) return error;