]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #31361 (simplexml/domxml segfault when adding node twice)
authorRob Richards <rrichards@php.net>
Sun, 2 Jan 2005 12:09:09 +0000 (12:09 +0000)
committerRob Richards <rrichards@php.net>
Sun, 2 Jan 2005 12:09:09 +0000 (12:09 +0000)
ext/libxml/libxml.c

index fcdd54c8b56fe7dd8490f5c468a296777403b5c3..626c6b3fdc07d7c8196215469d4b7410410d3747 100644 (file)
@@ -711,6 +711,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);