mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-17 21:48:07 +02:00
Free color glyphs hash table properly on error.
Signed-off-by: Raman Varabets <gitlab-20240601-da2ef10c@cyborgize.sg>
This commit is contained in:
parent
5aac7156dd
commit
d53079cfcc
1 changed files with 4 additions and 3 deletions
|
|
@ -1104,7 +1104,7 @@ _cairo_svg_surface_create_for_document (cairo_svg_document_t *document,
|
|||
surface->color_glyphs = _cairo_hash_table_create (_cairo_svg_color_glyph_equal);
|
||||
if (unlikely (surface->color_glyphs == NULL)) {
|
||||
status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
goto CLEANUP; // FIXME
|
||||
goto CLEANUP1;
|
||||
}
|
||||
|
||||
surface->xml_node = _cairo_svg_stream_create ();
|
||||
|
|
@ -1113,7 +1113,7 @@ _cairo_svg_surface_create_for_document (cairo_svg_document_t *document,
|
|||
surface->source_surfaces = _cairo_hash_table_create (_cairo_svg_source_surface_equal);
|
||||
if (unlikely (surface->source_surfaces == NULL)) {
|
||||
status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
goto CLEANUP;
|
||||
goto CLEANUP2;
|
||||
}
|
||||
|
||||
_cairo_surface_clipper_init (&surface->clipper, _cairo_svg_surface_clipper_intersect_clip_path);
|
||||
|
|
@ -1137,8 +1137,9 @@ _cairo_svg_surface_create_for_document (cairo_svg_document_t *document,
|
|||
}
|
||||
|
||||
/* ignore status as we are on the error path */
|
||||
CLEANUP:
|
||||
CLEANUP2:
|
||||
(void) _cairo_hash_table_destroy (surface->color_glyphs);
|
||||
CLEANUP1:
|
||||
(void) _cairo_svg_stream_destroy (&surface->xml_node);
|
||||
(void) _cairo_svg_document_destroy (document);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue