summaryrefslogtreecommitdiff
path: root/ext/libxml/libxml.c
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2007-07-28 08:32:51 +0000
committerRob Richards <rrichards@php.net>2007-07-28 08:32:51 +0000
commitb96a8a79ba090586acab4380b6b28dc41c28c790 (patch)
tree9602e13ef6fb30020fb10e37e4a4d6130062376c /ext/libxml/libxml.c
parent786621893e9590c9c45c4588ec748fdbb61e2fd8 (diff)
downloadphp-git-b96a8a79ba090586acab4380b6b28dc41c28c790.tar.gz
Fixed Bug #42112 (deleting a node produces memory corruption)
add test
Diffstat (limited to 'ext/libxml/libxml.c')
-rw-r--r--ext/libxml/libxml.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index 91adeaddea..50a2b4c937 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -240,11 +240,14 @@ static void php_libxml_node_free_list(xmlNodePtr node TSRMLS_DC)
case XML_ENTITY_REF_NODE:
php_libxml_node_free_list((xmlNodePtr) node->properties TSRMLS_CC);
break;
+ case XML_ATTRIBUTE_NODE:
+ if ((node->doc != NULL) && (((xmlAttrPtr) node)->atype == XML_ATTRIBUTE_ID)) {
+ xmlRemoveID(node->doc, (xmlAttrPtr) node);
+ }
case XML_ATTRIBUTE_DECL:
case XML_DTD_NODE:
case XML_DOCUMENT_TYPE_NODE:
case XML_ENTITY_DECL:
- case XML_ATTRIBUTE_NODE:
case XML_NAMESPACE_DECL:
case XML_TEXT_NODE:
php_libxml_node_free_list(node->children TSRMLS_CC);