]> gitweb.michael.orlitzky.com - libsvgtiny.git/commitdiff
src/svgtiny.c: cleanup immediately if sheet append fails
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 20 Oct 2024 15:22:25 +0000 (11:22 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 20 Oct 2024 21:48:50 +0000 (17:48 -0400)
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

index bc77cd04576c2c607527a49bff838cda1dd84a9c..b83b766f6a7fab93bb23ee75ff6592a28d195bdb 100644 (file)
@@ -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;
        }