summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/libxml/libxml.c4
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);