[cairo-ft-font] Destroy unscaled font ref on error.

Destroy the local reference taken to the unscaled font if we encounter
an error whilst creating the derived scaled font.
This commit is contained in:
Chris Wilson 2008-01-07 10:03:51 +00:00
parent 3b1411167c
commit 5fad969317

View file

@ -1495,6 +1495,7 @@ _cairo_ft_scaled_font_create (cairo_ft_unscaled_font_t *unscaled,
font_matrix, ctm, options,
&cairo_ft_scaled_font_backend);
if (status) {
_cairo_unscaled_font_destroy (&unscaled->base);
free (scaled_font);
goto FAIL;
}
@ -1502,6 +1503,7 @@ _cairo_ft_scaled_font_create (cairo_ft_unscaled_font_t *unscaled,
status = _cairo_ft_unscaled_font_set_scale (unscaled,
&scaled_font->base.scale);
if (status) {
_cairo_unscaled_font_destroy (&unscaled->base);
free (scaled_font);
goto FAIL;
}