summaryrefslogtreecommitdiff
path: root/src/cairo-scaled-font.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-08-28 15:51:33 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-08-29 17:07:39 +0100
commite76856e6ee563affc0a273ed6eef865866802dec (patch)
tree6a0c8a6e3aa53a24425517ed47c959293266d5a8 /src/cairo-scaled-font.c
parentd7d6f75ed26bc3ea040c618442ba71c89633ac7b (diff)
[scaled-font] Refleak on error path.
Perform the destroy of the local font before returning along the error path.
Diffstat (limited to 'src/cairo-scaled-font.c')
-rw-r--r--src/cairo-scaled-font.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index 9de92e06..812a8082 100644
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -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);