[subset] fix memory leak.

Fixes fuzzer issue https://oss-fuzz.com/testcase-detail/6169920089227264
This commit is contained in:
Garret Rieger authored and Behdad Esfahbod committed 2023-03-30 16:19:41 -06:00
1 parent 453ded0539
commit 2cd81fdfb6
2 files changed
+2 -1

No files matched your search

+2 -1
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 ());