From f91d9b3d06b95863efbd769eaef0e28bf6e3736f Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Thu, 18 Jul 2024 19:33:24 +0200 Subject: [PATCH] [dom] dom_namednodemap_unref(attrs) not dom_node_unref(attrs) --- src/ecmascript/ecmascript-c.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ecmascript/ecmascript-c.c b/src/ecmascript/ecmascript-c.c index 10a417b6..1bbea650 100644 --- a/src/ecmascript/ecmascript-c.c +++ b/src/ecmascript/ecmascript-c.c @@ -822,7 +822,7 @@ el_dump_element(struct string *buf, dom_node *node, bool toSortAttrs) dom_exception exc; dom_string *node_name = NULL; dom_node_type type; - dom_namednodemap *attrs; + dom_namednodemap *attrs = NULL; /* Only interested in element nodes */ exc = dom_node_get_node_type(node, &type); @@ -887,7 +887,9 @@ el_dump_element(struct string *buf, dom_node *node, bool toSortAttrs) } } } - dom_node_unref(attrs); + } + if (attrs) { + dom_namednodemap_unref(attrs); } add_char_to_string(buf, '>');