From: Michael Wallner Date: Mon, 15 Jun 2015 14:49:21 +0000 (+0200) Subject: fix leak X-Git-Tag: RELEASE_3_0_0_RC1~43 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=03045a17d712ce52e0a55c7d8f2cc30b48b3a645;p=m6w6%2Fext-http fix leak --- diff --git a/php_http_client_curl.c b/php_http_client_curl.c index 9b44aa0..a9b8c7f 100644 --- a/php_http_client_curl.c +++ b/php_http_client_curl.c @@ -2143,9 +2143,6 @@ static php_resource_factory_t *create_rf(php_http_client_t *h, php_http_client_e int port = url->port ? url->port : 80; zval *zport; - id_len = spprintf(&id_str, 0, "%s:%d", STR_PTR(url->host), url->port ? url->port : 80); - id = php_http_cs2zs(id_str, id_len); - if ((zport = zend_hash_str_find(enqueue->options, ZEND_STRL("port")))) { zend_long lport = zval_get_long(zport); @@ -2155,6 +2152,7 @@ static php_resource_factory_t *create_rf(php_http_client_t *h, php_http_client_e } id_len = spprintf(&id_str, 0, "%s:%d", STR_PTR(url->host), port); + id = php_http_cs2zs(id_str, id_len); pf = php_persistent_handle_concede(NULL, PHP_HTTP_G->client.curl.driver.request_name, id, NULL, NULL); zend_string_release(id); }