[subset] fix memory leak.

Fixes fuzzer issue https://oss-fuzz.com/testcase-detail/6169920089227264
This commit is contained in:
Garret Rieger 2023-03-30 22:11:43 +00:00 committed by Behdad Esfahbod
parent 453ded0539
commit 2cd81fdfb6
2 changed files with 2 additions and 1 deletions

View File

@ -386,11 +386,12 @@ _collect_layout_variation_indices (hb_subset_plan_t* plan)
if (collect_delta)
{
if (unlikely (!plan->check_success (font = _get_hb_font_with_variations (plan)))) {
hb_font_destroy (font);
gdef.destroy ();
gpos.destroy ();
return;
}
if (gdef->has_var_store ())
{
var_store = &(gdef->get_var_store ());