[blob] Fix-up recent mistake in hb_blob_create() destroy(user_data)

https://github.com/harfbuzz/harfbuzz/pull/3026#discussion_r653437491
This commit is contained in:
Behdad Esfahbod 2021-06-20 18:47:03 -06:00
parent bc06af977f
commit cc9bb29491
1 changed files with 4 additions and 0 deletions

View File

@ -73,7 +73,11 @@ hb_blob_create (const char *data,
hb_destroy_func_t destroy)
{
if (!length)
{
if (destroy)
destroy (user_data);
return hb_blob_get_empty ();
}
hb_blob_t *blob = hb_blob_create_or_fail (data, length, mode,
user_data, destroy);