From: Sriram Natarajan Date: Tue, 5 Jan 2010 19:25:23 +0000 (+0000) Subject: - Addressing minor leak noticed while addressing bug #48590 X-Git-Tag: php-5.2.13RC1~49 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad853ae33952f855d606260967f532913c5ab4c9;p=php - Addressing minor leak noticed while addressing bug #48590 --- diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 7dbf40a673..dd0a6d856a 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -709,18 +709,17 @@ try_again: smart_str_0(&soap_headers); err = php_stream_write(stream, soap_headers.c, soap_headers.len); + smart_str_free(&soap_headers); if (err != soap_headers.len) { if (request != buf) {efree(request);} - smart_str_free(&soap_headers); php_stream_close(stream); zend_hash_del(Z_OBJPROP_P(this_ptr), "httpurl", sizeof("httpurl")); zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")); zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")); add_soap_fault(this_ptr, "HTTP", "Failed Sending HTTP SOAP request", NULL, NULL TSRMLS_CC); + smart_str_free(&soap_headers_z); return FALSE; } - smart_str_free(&soap_headers); - } else { add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", NULL, NULL TSRMLS_CC); smart_str_free(&soap_headers_z); @@ -969,8 +968,8 @@ try_again: phpurl = new_url; if (--redirect_max < 1) { - smart_str_free(&soap_headers_z); add_soap_fault(this_ptr, "HTTP", "Redirection limit reached, aborting", NULL, NULL TSRMLS_CC); + smart_str_free(&soap_headers_z); return FALSE; }