From: Michael Orlitzky Date: Sat, 19 Oct 2024 21:53:53 +0000 (-0400) Subject: src/svgtiny.c: add missing svgtiny_cleanup_state_local() on error path X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=b6c049af93f94013073ff1d444e9a3fd7bd61013;p=libsvgtiny.git 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. --- 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) {