From b6c049af93f94013073ff1d444e9a3fd7bd61013 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 19 Oct 2024 17:53:53 -0400 Subject: [PATCH] src/svgtiny.c: add missing svgtiny_cleanup_state_local() on error path There's an error path in svgtiny_parse_svg() that leads to returning svgtiny_LIBDOM_ERROR early. But unlike all of the other early returns in that function, this one is missing svgtiny_cleanup_state_local(). We add it. --- src/svgtiny.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/svgtiny.c b/src/svgtiny.c index 9a6709a..3d5cd2c 100644 --- a/src/svgtiny.c +++ b/src/svgtiny.c @@ -1038,6 +1038,7 @@ svgtiny_code svgtiny_parse_svg(dom_element *svg, exc = dom_node_get_node_type(child, &nodetype); if (exc != DOM_NO_ERR) { dom_node_unref(child); + svgtiny_cleanup_state_local(&state); return svgtiny_LIBDOM_ERROR; } if (nodetype == DOM_ELEMENT_NODE) { -- 2.44.2