From: Michael Orlitzky Date: Sun, 20 Oct 2024 15:22:25 +0000 (-0400) Subject: src/svgtiny.c: cleanup immediately if sheet append fails X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=7f81e591dc7512c2a4540ae09a95f24b735d5da4;p=libsvgtiny.git 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. --- 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; }