Skip to content

Commit 70b65f3

Browse files
committed
Merge branch 'PHP-5.4' into PHP-5.5
2 parents 4e7db3e + 3d86e6d commit 70b65f3

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Zend/zend_API.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3708,6 +3708,8 @@ ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *na
37083708
(*property)->value = value->value;
37093709
if (Z_REFCOUNT_P(value) > 0) {
37103710
zval_copy_ctor(*property);
3711+
} else {
3712+
efree(value);
37113713
}
37123714
} else {
37133715
zval *garbage = *property;

Zend/zend_compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3463,7 +3463,7 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
34633463
if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) {
34643464
zend_error(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
34653465
} else if ((child_info->flags & ZEND_ACC_STATIC) == 0) {
3466-
Z_DELREF_P(ce->default_properties_table[parent_info->offset]);
3466+
zval_ptr_dtor(&(ce->default_properties_table[parent_info->offset]));
34673467
ce->default_properties_table[parent_info->offset] = ce->default_properties_table[child_info->offset];
34683468
ce->default_properties_table[child_info->offset] = NULL;
34693469
child_info->offset = parent_info->offset;

Zend/zend_object_handlers.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,8 @@ ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, c
539539
(*variable_ptr)->value = value->value;
540540
if (Z_REFCOUNT_P(value) > 0) {
541541
zval_copy_ctor(*variable_ptr);
542+
} else {
543+
efree(value);
542544
}
543545
zval_dtor(&garbage);
544546
} else {

0 commit comments

Comments
 (0)