diff --git a/src/document/libdom/renderer.c b/src/document/libdom/renderer.c index d1245b60b..46f446a04 100644 --- a/src/document/libdom/renderer.c +++ b/src/document/libdom/renderer.c @@ -106,7 +106,7 @@ dump_dom_element(void *mapa, struct string *buf, dom_node *node, int depth) 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); @@ -169,7 +169,7 @@ dump_dom_element(void *mapa, struct string *buf, dom_node *node, int depth) } } } - dom_node_unref(attrs); + dom_namednodemap_unref(attrs); } add_char_to_string(buf, '>'); diff --git a/src/document/libdom/renderer2.c b/src/document/libdom/renderer2.c index 16e35e520..5499e7888 100644 --- a/src/document/libdom/renderer2.c +++ b/src/document/libdom/renderer2.c @@ -108,7 +108,7 @@ dump_dom_element(void *mapa, struct string *buf, dom_node *node, int depth) 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); @@ -171,7 +171,9 @@ dump_dom_element(void *mapa, struct string *buf, dom_node *node, int depth) } } } - dom_node_unref(attrs); + } + if (attrs) { + dom_namednodemap_unref(attrs); } add_char_to_string(buf, '>');