From 7f81e591dc7512c2a4540ae09a95f24b735d5da4 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 20 Oct 2024 11:22:25 -0400 Subject: [PATCH] src/svgtiny.c: cleanup immediately if sheet append fails If we fail to append to current sheet to the css_select_ctx in svgtiny_parse_style_element(), we should destroy that sheet right away, before returning an error. --- src/svgtiny.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/svgtiny.c b/src/svgtiny.c index bc77cd0..b83b766 100644 --- a/src/svgtiny.c +++ b/src/svgtiny.c @@ -871,6 +871,7 @@ svgtiny_code svgtiny_parse_style_element(dom_element *style, NULL); if (code != CSS_OK) { dom_string_unref(data); + css_stylesheet_destroy(sheet); return svgtiny_LIBCSS_ERROR; } -- 2.44.2