X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=php_http_message.c;h=e6cdbc8f143782b56784239e6ebde8e16b552477;hb=4bf1b4570329514fa00dc68c6e02f581c3792d73;hp=0982f06c34b08502c39cc38e5506fa8f68e8bcdc;hpb=1f37d09e4c7f55cf6f2c3c10ea3ec2424a482671;p=m6w6%2Fext-http diff --git a/php_http_message.c b/php_http_message.c index 0982f06..e6cdbc8 100644 --- a/php_http_message.c +++ b/php_http_message.c @@ -878,6 +878,8 @@ static zval *php_http_message_object_read_prop(zval *object, zval *member, int t zval_ptr_dtor(return_value); ZVAL_COPY_VALUE(return_value, tmp); } + zend_string_release(member_name); + return return_value; } else { php_property_proxy_t *proxy; php_property_proxy_object_t *proxy_obj; @@ -886,12 +888,9 @@ static zval *php_http_message_object_read_prop(zval *object, zval *member, int t proxy_obj = php_property_proxy_object_new_ex(NULL, proxy); ZVAL_OBJ(tmp, &proxy_obj->zo); + zend_string_release(member_name); return tmp; } - - zend_string_release(member_name); - - return return_value; } static void php_http_message_object_write_prop(zval *object, zval *member, zval *value, void **cache_slot) @@ -1576,10 +1575,10 @@ static PHP_METHOD(HttpMessage, setRequestUrl) url = php_http_url_from_zval(zurl, ~0); zend_restore_error_handling(&zeh); - if (php_http_url_is_empty(url)) { + if (url && php_http_url_is_empty(url)) { php_http_url_free(&url); php_http_throw(invalid_arg, "Cannot set http\\Message's request url to an empty string", NULL); - } else { + } else if (url) { PTR_SET(obj->message->http.info.request.url, url); }