From d8c712f41c75fd4e407b944bf92f3ea1a0a10d52 Mon Sep 17 00:00:00 2001 From: egoism <13751766+l4rzy@users.noreply.github.com> Date: Tue, 15 Sep 2026 22:16:07 -0500 Subject: [PATCH] Fix memory leak in graphite2 face shaper unhappy path (#6263) --- src/hb-graphite2.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hb-graphite2.cc b/src/hb-graphite2.cc index 6d8352718..c035543c1 100644 --- a/src/hb-graphite2.cc +++ b/src/hb-graphite2.cc @@ -128,7 +128,9 @@ _hb_graphite2_shaper_face_data_create (hb_face_t *face) data->grface = gr_make_face_with_ops (data, &ops, gr_face_preloadAll); if (unlikely (!data->grface)) { - hb_free (data); + /* data->tlist has already been populated by the callback, + * so everything needs to be destroyed */ + _hb_graphite2_shaper_face_data_destroy (data); return nullptr; }