From 0347914eda73287d017c6512dfe870382312299a Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 15 Jun 2015 16:35:34 +0200 Subject: [PATCH] fix leaks; all tests pass --- php_http_message.c | 9 ++++++++- tests/propertyproxy001.phpt | 12 +++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/php_http_message.c b/php_http_message.c index 75d7fe5..a885cb5 100644 --- a/php_http_message.c +++ b/php_http_message.c @@ -872,7 +872,14 @@ static zval *php_http_message_object_read_prop(zval *object, zval *member, int t ZVAL_COPY_VALUE(return_value, tmp); } } else { - return_value = php_property_proxy_zval(object, member_name); + php_property_proxy_t *proxy; + php_property_proxy_object_t *proxy_obj; + + proxy = php_property_proxy_init(object, member_name); + proxy_obj = php_property_proxy_object_new_ex(NULL, proxy); + + ZVAL_OBJ(tmp, &proxy_obj->zo); + return tmp; } zend_string_release(member_name); diff --git a/tests/propertyproxy001.phpt b/tests/propertyproxy001.phpt index 1001f8e..a1dc2d8 100644 --- a/tests/propertyproxy001.phpt +++ b/tests/propertyproxy001.phpt @@ -4,8 +4,6 @@ property proxy ---XFAIL-- -TBD --FILE-- int(2) ["by2ref"]=> - &int(1) + int(1) } array(4) { ["bykey"]=> @@ -65,9 +63,9 @@ array(4) { ["by1ref"]=> int(2) ["by2ref"]=> - &int(1) + int(1) ["byXref"]=> - &int(2) + int(2) } array(5) { ["bykey"]=> @@ -75,9 +73,9 @@ array(5) { ["by1ref"]=> int(2) ["by2ref"]=> - &int(1) + int(1) ["byXref"]=> - &int(2) + int(2) ["bynext"]=> array(3) { [0]=> -- 2.30.2