mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-13 16:50:38 +00:00
[subset] don't leak memory for duplicate tables.
This commit is contained in:
parent
f7a9c3ea93
commit
222b74f08f
1 changed files with 2 additions and 0 deletions
|
@ -757,11 +757,13 @@ hb_face_builder_add_table (hb_face_t *face, hb_tag_t tag, hb_blob_t *blob)
|
|||
|
||||
hb_face_builder_data_t *data = (hb_face_builder_data_t *) face->user_data;
|
||||
|
||||
hb_blob_t* previous = data->tables.get (tag);
|
||||
if (!data->tables.set (tag, hb_blob_reference (blob)))
|
||||
{
|
||||
hb_blob_destroy (blob);
|
||||
return false;
|
||||
}
|
||||
|
||||
hb_blob_destroy (previous);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue