fixed memory leaks

in CFF1 & CFF2 accelerators, VORG subsetter
This commit is contained in:
Michiharu Ariza 2018-09-24 22:49:44 -07:00
parent 258b456566
commit ae7f0e83d4
3 changed files with 7 additions and 0 deletions

View File

@ -1093,6 +1093,8 @@ struct cff1
sc.end_processing ();
topDict.fini ();
fontDicts.fini ();
for (unsigned int i = 0; i < privateDicts.len; i++)
privateDicts[i].fini ();
privateDicts.fini ();
hb_blob_destroy (blob);
blob = nullptr;

View File

@ -491,6 +491,8 @@ struct cff2
{
sc.end_processing ();
fontDicts.fini ();
for (unsigned int i = 0; i < privateDicts.len; i++)
privateDicts[i].fini ();
privateDicts.fini ();
hb_blob_destroy (blob);
blob = nullptr;

View File

@ -129,6 +129,7 @@ struct VORG
if (unlikely (!dest))
{
subset_metrics.fini ();
hb_blob_destroy (vorg_blob);
return false;
}
@ -137,6 +138,7 @@ struct VORG
{
subset_metrics.fini ();
free (dest);
hb_blob_destroy (vorg_blob);
return false;
}
@ -148,6 +150,7 @@ struct VORG
bool success = plan->add_table (HB_OT_TAG_VORG, result);
hb_blob_destroy (result);
subset_metrics.fini ();
hb_blob_destroy (vorg_blob);
return success;
}