1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 22:11:12 +02:00

Fixed bug #48781 (Cyclical garbage collector memory leak)

This commit is contained in:
Dmitry Stogov
2010-04-20 12:30:35 +00:00
parent f507cc9cf6
commit b6ae8a964b

View File

@@ -848,6 +848,7 @@ static inline zval* zend_assign_tmp_to_variable(zval **variable_ptr_ptr, zval *v
zendi_zval_dtor(garbage);
return variable_ptr;
} else { /* we need to split */
GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr);
ALLOC_ZVAL(variable_ptr);
INIT_PZVAL_COPY(variable_ptr, value);
*variable_ptr_ptr = variable_ptr;
@@ -901,6 +902,7 @@ static inline zval* zend_assign_to_variable(zval **variable_ptr_ptr, zval *value
return value;
}
} else { /* we need to split */
GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr);
if (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) {
ALLOC_ZVAL(variable_ptr);
INIT_PZVAL_COPY(variable_ptr, value);