From: Rob Richards Date: Sun, 2 Jan 2005 12:08:41 +0000 (+0000) Subject: Fixed bug #31361 (simplexml/domxml segfault when adding node twice) X-Git-Tag: RELEASE_0_2~417 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8450fae834dcdecda6875a2607e09425badadaac;p=php Fixed bug #31361 (simplexml/domxml segfault when adding node twice) --- 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);