Fixed bug #63726 (Memleak with static properties and internal/user classes)

This commit is contained in:
Xinchen Hui 2012-12-10 20:28:27 +08:00
parent db6d8e2724
commit ad553a7af2
3 changed files with 6 additions and 0 deletions

2
NEWS
View File

@ -7,6 +7,8 @@ PHP NEWS
#### ADD NEWS TO 5.3.21 ONLY ####
- Zend Engine:
. Fixed bug #63726 (Memleak with static properties and internal/user
classes). (Laruence)
. Fixed bug #63635 (Segfault in gc_collect_cycles). (Dmitry)
. Fixed bug #63512 (parse_ini_file() with INI_SCANNER_RAW removes quotes
from value). (Pierrick)

View File

@ -3472,6 +3472,8 @@ ZEND_API int zend_update_static_property(zend_class_entry *scope, char *name, in
(*property)->value = value->value;
if (Z_REFCOUNT_P(value) > 0) {
zval_copy_ctor(*property);
} else {
efree(value);
}
} else {
zval *garbage = *property;

View File

@ -437,6 +437,8 @@ static void zend_std_write_property(zval *object, zval *member, zval *value TSRM
(*variable_ptr)->value = value->value;
if (Z_REFCOUNT_P(value) > 0) {
zval_copy_ctor(*variable_ptr);
} else {
efree(value);
}
zval_dtor(&garbage);
} else {