diff options
author | Rob Richards <rrichards@php.net> | 2005-01-02 12:08:41 +0000 |
---|---|---|
committer | Rob Richards <rrichards@php.net> | 2005-01-02 12:08:41 +0000 |
commit | 8450fae834dcdecda6875a2607e09425badadaac (patch) | |
tree | 31e0f306b571ea3c0461fd6f78d8b76304329cd9 /ext/libxml/libxml.c | |
parent | 88ce94a3c2a9fca658add5eb8fca38674fa7a0b8 (diff) | |
download | php-git-8450fae834dcdecda6875a2607e09425badadaac.tar.gz |
Fixed bug #31361 (simplexml/domxml segfault when adding node twice)
Diffstat (limited to 'ext/libxml/libxml.c')
-rw-r--r-- | ext/libxml/libxml.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 6fd7506414..16cc1aa40a 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -725,6 +725,10 @@ void php_libxml_node_decrement_resource(php_libxml_node_object *object TSRMLS_DC ret_refcount = php_libxml_decrement_node_ptr(object TSRMLS_CC); if (ret_refcount == 0) { php_libxml_node_free_resource(nodep TSRMLS_CC); + } else { + if (obj_node && object == obj_node->_private) { + obj_node->_private = NULL; + } } /* Safe to call as if the resource were freed then doc pointer is NULL */ php_libxml_decrement_doc_ref(object TSRMLS_CC); |