[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.
This commit is contained in:
Chris Wilson 2007-05-12 15:42:59 +01:00
parent 76e758df5b
commit 37d8c18b3f

View file

@ -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;