From 37d8c18b3fc489d6336131bae6ec219cafc35718 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 12 May 2007 15:42:59 +0100 Subject: [PATCH] [cairo-scaled-font-subsets] Destroy the glyph if we fail to cache it. If we fail to insert the glyph into the sub_font glyph cache then we must destroy it before propagating the error. --- src/cairo-scaled-font-subsets.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cairo-scaled-font-subsets.c b/src/cairo-scaled-font-subsets.c index 53ea5afb4..b32796337 100644 --- a/src/cairo-scaled-font-subsets.c +++ b/src/cairo-scaled-font-subsets.c @@ -338,8 +338,10 @@ _cairo_sub_font_map_glyph (cairo_sub_font_t *sub_font, } status = _cairo_hash_table_insert (sub_font->sub_font_glyphs, &sub_font_glyph->base); - if (status) + if (status) { + _cairo_sub_font_glyph_destroy (sub_font_glyph); return status; + } } subset_glyph->font_id = sub_font->font_id;