[var] Minor lifecycle adjustment

This commit is contained in:
Behdad Esfahbod 2017-01-21 14:50:22 -08:00
parent bf0d3a665b
commit 0dcc7b49a8
1 changed files with 2 additions and 2 deletions

View File

@ -1556,11 +1556,11 @@ hb_font_set_var_coords_normalized (hb_font_t *font,
if (unlikely (coords_length && !copy)) if (unlikely (coords_length && !copy))
return; return;
free (font->coords);
if (coords_length) if (coords_length)
memcpy (copy, coords, coords_length * sizeof (coords[0])); memcpy (copy, coords, coords_length * sizeof (coords[0]));
free (font->coords);
font->coords = copy; font->coords = copy;
font->num_coords = coords_length; font->num_coords = coords_length;
} }