summaryrefslogtreecommitdiff
path: root/Zend/zend_variables.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_variables.c')
-rw-r--r--Zend/zend_variables.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c
index b9fc79ff35..90415ba47e 100644
--- a/Zend/zend_variables.c
+++ b/Zend/zend_variables.c
@@ -68,6 +68,12 @@ ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC)
}
}
break;
+ case IS_REFERENCE:
+ if (Z_DELREF_P(zvalue) == 0) {
+ zval_dtor(Z_REFVAL_P(zvalue));
+ efree(Z_REF_P(zvalue));
+ }
+ break;
case IS_LONG:
case IS_DOUBLE:
case IS_BOOL:
@@ -117,6 +123,10 @@ ZEND_API void _zval_dtor_func_for_ptr(zval *zvalue ZEND_FILE_LINE_DC)
zend_list_delete(Z_RES_P(zvalue));
}
break;
+ case IS_REFERENCE:
+ zval_dtor(Z_REFVAL_P(zvalue));
+ efree(Z_REF_P(zvalue));
+ break;
case IS_LONG:
case IS_DOUBLE:
case IS_BOOL: