aboutsummaryrefslogtreecommitdiffstats
path: root/tree.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2012-08-08 15:31:55 +0800
committerDaniel Veillard <veillard@redhat.com>2012-08-08 15:31:55 +0800
commit6ca24a39d0eb7fd7378a5bc8be3286bf745a36ba (patch)
tree6f6735b94c5e04e3e58d72eb79738fa94effad2f /tree.c
parent89b6f73aea631ab1cca7b9fed71f8add205a08cf (diff)
downloadandroid_external_libxml2-6ca24a39d0eb7fd7378a5bc8be3286bf745a36ba.tar.gz
android_external_libxml2-6ca24a39d0eb7fd7378a5bc8be3286bf745a36ba.tar.bz2
android_external_libxml2-6ca24a39d0eb7fd7378a5bc8be3286bf745a36ba.zip
Namespace nodes can't be unlinked with xmlUnlinkNode
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tree.c b/tree.c
index 577331ed..8169d6dc 100644
--- a/tree.c
+++ b/tree.c
@@ -3754,6 +3754,8 @@ xmlFreeNode(xmlNodePtr cur) {
* Unlink a node from it's current context, the node is not freed
* If one need to free the node, use xmlFreeNode() routine after the
* unlink to discard it.
+ * Note that namespace nodes can't be unlinked as they do not have
+ * pointer to their parent.
*/
void
xmlUnlinkNode(xmlNodePtr cur) {
@@ -3764,6 +3766,8 @@ xmlUnlinkNode(xmlNodePtr cur) {
#endif
return;
}
+ if (cur->type == XML_NAMESPACE_DECL)
+ return;
if (cur->type == XML_DTD_NODE) {
xmlDocPtr doc;
doc = cur->doc;