[subset] Fix memory leak in plan creation.

This commit is contained in:
Garret Rieger 2022-02-11 16:19:43 -08:00
parent 670ef070bd
commit 27a6c895ba
1 changed files with 2 additions and 0 deletions

View File

@ -516,6 +516,7 @@ hb_subset_plan_create_or_fail (hb_face_t *face,
plan->layout_variation_idx_map = hb_map_create ();
if (unlikely (plan->in_error ())) {
hb_subset_plan_destroy (plan);
return nullptr;
}
@ -534,6 +535,7 @@ hb_subset_plan_create_or_fail (hb_face_t *face,
&plan->_num_output_glyphs);
if (unlikely (plan->in_error ())) {
hb_subset_plan_destroy (plan);
return nullptr;
}
return plan;