fix read_property handler (return_value lives on stack of zend_read_property)
authorMichael Wallner <mike@php.net>
Wed, 21 Jan 2015 16:10:29 +0000 (17:10 +0100)
committerMichael Wallner <mike@php.net>
Wed, 21 Jan 2015 16:10:29 +0000 (17:10 +0100)
php_http_message.c

index bf8eb508528c16b7439ccb8d7ca07760004e61d0..f391d5fd989019a71c962aa80b18dbb265fcfc43 100644 (file)
@@ -859,15 +859,18 @@ static zval *php_http_message_object_read_prop(zval *object, zval *member, int t
 
        PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
 
+       /* supplied retun_value lives on the stack of zend_read_property! */
+       return_value = zend_get_std_object_handlers()->read_property(object, member, type, cache_slot, return_value);
+
        if ((handler = php_http_message_object_get_prophandler(member_name))) {
+               zval_dtor(return_value);
+
                if (type == BP_VAR_R) {
                        handler->read(obj, return_value);
                } else {
                        php_property_proxy_t *proxy = php_property_proxy_init(object, member_name);
                        RETVAL_OBJ(&php_property_proxy_object_new_ex(php_property_proxy_get_class_entry(), proxy)->zo);
                }
-       } else {
-               zend_get_std_object_handlers()->read_property(object, member, type, cache_slot, return_value);
        }
 
        zend_string_release(member_name);