[unicode] Destroy user_data in set_funcs fail paths

This is what the font_funcs / draw_funcs do.
This commit is contained in:
Behdad Esfahbod 2022-11-19 15:23:44 -07:00
parent 527823ccac
commit 2d8ff3bcbe
1 changed files with 3 additions and 2 deletions

View File

@ -379,9 +379,10 @@ hb_unicode_funcs_set_##name##_func (hb_unicode_funcs_t *ufuncs, \
if (hb_object_is_immutable (ufuncs)) \
goto fail; \
\
if (!func && destroy) \
if (!func) \
{ \
destroy (user_data); \
if (destroy) \
destroy (user_data); \
destroy = nullptr; \
user_data = nullptr; \
} \