mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-29 23:10:21 +01:00
[scaled-font] Refleak on error path.
Perform the destroy of the local font before returning along the error path.
This commit is contained in:
parent
d7d6f75ed2
commit
e76856e6ee
1 changed files with 4 additions and 5 deletions
|
|
@ -1063,6 +1063,10 @@ cairo_scaled_font_create (cairo_font_face_t *font_face,
|
|||
|
||||
_cairo_scaled_font_map_unlock ();
|
||||
|
||||
cairo_scaled_font_destroy (old);
|
||||
if (font_face != original_font_face)
|
||||
cairo_font_face_destroy (font_face);
|
||||
|
||||
if (unlikely (status)) {
|
||||
/* We can't call _cairo_scaled_font_destroy here since it expects
|
||||
* that the font has already been successfully inserted into the
|
||||
|
|
@ -1072,11 +1076,6 @@ cairo_scaled_font_create (cairo_font_face_t *font_face,
|
|||
return _cairo_scaled_font_create_in_error (status);
|
||||
}
|
||||
|
||||
cairo_scaled_font_destroy (old);
|
||||
|
||||
if (font_face != original_font_face)
|
||||
cairo_font_face_destroy (font_face);
|
||||
|
||||
return scaled_font;
|
||||
}
|
||||
slim_hidden_def (cairo_scaled_font_create);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue