Skip to content

Commit ad553a7

Browse files
committed
Fixed bug #63726 (Memleak with static properties and internal/user classes)
1 parent db6d8e2 commit ad553a7

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ PHP NEWS
77
#### ADD NEWS TO 5.3.21 ONLY ####
88

99
- Zend Engine:
10+
. Fixed bug #63726 (Memleak with static properties and internal/user
11+
classes). (Laruence)
1012
. Fixed bug #63635 (Segfault in gc_collect_cycles). (Dmitry)
1113
. Fixed bug #63512 (parse_ini_file() with INI_SCANNER_RAW removes quotes
1214
from value). (Pierrick)

Zend/zend_API.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3472,6 +3472,8 @@ ZEND_API int zend_update_static_property(zend_class_entry *scope, char *name, in
34723472
(*property)->value = value->value;
34733473
if (Z_REFCOUNT_P(value) > 0) {
34743474
zval_copy_ctor(*property);
3475+
} else {
3476+
efree(value);
34753477
}
34763478
} else {
34773479
zval *garbage = *property;

Zend/zend_object_handlers.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,8 @@ static void zend_std_write_property(zval *object, zval *member, zval *value TSRM
437437
(*variable_ptr)->value = value->value;
438438
if (Z_REFCOUNT_P(value) > 0) {
439439
zval_copy_ctor(*variable_ptr);
440+
} else {
441+
efree(value);
440442
}
441443
zval_dtor(&garbage);
442444
} else {

0 commit comments

Comments
 (0)