From 597b1fd1fa34999ec47bbd574da35491f56b8893 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Wed, 6 Nov 2024 22:08:21 -0800 Subject: [PATCH] XML: fixed tests with libxml2 2.13 and later. This fixes #812 issue on Github. --- external/njs_xml_module.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/external/njs_xml_module.c b/external/njs_xml_module.c index 86c896c0..d9f3bbb5 100644 --- a/external/njs_xml_module.c +++ b/external/njs_xml_module.c @@ -1275,17 +1275,13 @@ njs_xml_node_tags_handler(njs_vm_t *vm, xmlNode *current, njs_str_t *name, /* set or delete. */ - copy = xmlDocCopyNode(current, current->doc, 1); + copy = xmlDocCopyNode(current, current->doc, + 2 /* copy properties and namespaces */); if (njs_slow_path(copy == NULL)) { njs_vm_internal_error(vm, "xmlDocCopyNode() failed"); return NJS_ERROR; } - if (copy->children != NULL) { - xmlFreeNodeList(copy->children); - copy->children = NULL; - } - if (retval == NULL) { /* delete. */ return njs_xml_replace_node(vm, current, copy); -- 2.47.3