From 73f2f935a077274fef3343e36352b4e01678d662 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 4 Jun 2023 09:12:18 -0600 Subject: [PATCH] [subset/glyf] Fix another leak --- src/OT/glyf/glyf.hh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/OT/glyf/glyf.hh b/src/OT/glyf/glyf.hh index 7790618e7..03157ebb9 100644 --- a/src/OT/glyf/glyf.hh +++ b/src/OT/glyf/glyf.hh @@ -102,8 +102,6 @@ struct glyf if (font) hb_font_destroy (font); - // Calculate glyph sizes for `loca` table - hb_vector_t padded_offsets; if (unlikely (!padded_offsets.alloc (glyphs.length, true))) { @@ -139,7 +137,11 @@ struct glyf } glyf *glyf_prime = c->serializer->start_embed (); - if (unlikely (!glyf_prime)) return_trace (false); + if (unlikely (!glyf_prime)) + { + _free_compiled_subset_glyphs (glyphs); + return_trace (false); + } bool result = glyf_prime->serialize (c->serializer, hb_iter (glyphs), use_short_loca, c->plan); if (c->plan->normalized_coords && !c->plan->pinned_at_default)