I think following code in edit_merge_list() has problem. merge_code shall be added directly without xmlCopyNode(), otherwise there shall be memory leak, because merge_code is not released at all.
if (refnode != NULL) {
/* relink th node before the currently first instance of the list */
xmlAddPrevSibling(refnode, xmlCopyNode(merged_node, 1));
} else {
/* re-link the node as last node since there is currently no instance of the list */
xmlAddChild(parent, xmlCopyNode(merged_node, 1));
}
shall be
if (refnode != NULL) {
/* relink th node before the currently first instance of the list */
xmlAddPrevSibling(refnode, merged_node);
} else {
/* re-link the node as last node since there is currently no instance of the list */
xmlAddChild(parent, merged_node);
}
Hi,
I think following code in
edit_merge_list()
has problem.merge_code
shall be added directly withoutxmlCopyNode()
, otherwise there shall be memory leak, becausemerge_code
is not released at all.shall be