summaryrefslogtreecommitdiff
path: root/ext/soap/php_http.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2007-07-13 09:14:03 +0000
committerDmitry Stogov <dmitry@php.net>2007-07-13 09:14:03 +0000
commit1e768865dce01e401e479f415900e782892cd23d (patch)
treeee9248d8d2c6945fae74cd5fc05cccbeff27cb48 /ext/soap/php_http.c
parent3dff7a7dba9f2ae20854586836a59c7c37b0944a (diff)
downloadphp-git-1e768865dce01e401e479f415900e782892cd23d.tar.gz
Fixed memleak
Diffstat (limited to 'ext/soap/php_http.c')
-rw-r--r--ext/soap/php_http.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index e59934dd78..c816d21788 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -288,6 +288,7 @@ int make_http_soap_request(zval *this_ptr,
request_size = Z_STRLEN(retval);
} else {
if (request != buf) {efree(request);}
+ smart_str_free(&soap_headers_z);
return FALSE;
}
}
@@ -311,6 +312,7 @@ try_again:
if (phpurl != NULL) {php_url_free(phpurl);}
if (request != buf) {efree(request);}
add_soap_fault(this_ptr, "HTTP", "Unable to parse URL", NULL, NULL TSRMLS_CC);
+ smart_str_free(&soap_headers_z);
return FALSE;
}
@@ -321,6 +323,7 @@ try_again:
php_url_free(phpurl);
if (request != buf) {efree(request);}
add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http and https are allowed.", NULL, NULL TSRMLS_CC);
+ smart_str_free(&soap_headers_z);
return FALSE;
}
@@ -331,6 +334,7 @@ try_again:
if (request != buf) {efree(request);}
add_soap_fault(this_ptr, "HTTP", "SSL support is not available in this build", NULL, NULL TSRMLS_CC);
PG(allow_url_fopen) = old_allow_url_fopen;
+ smart_str_free(&soap_headers_z);
return FALSE;
}
@@ -380,6 +384,7 @@ try_again:
if (request != buf) {efree(request);}
add_soap_fault(this_ptr, "HTTP", "Could not connect to host", NULL, NULL TSRMLS_CC);
PG(allow_url_fopen) = old_allow_url_fopen;
+ smart_str_free(&soap_headers_z);
return FALSE;
}
}
@@ -438,7 +443,6 @@ try_again:
}
smart_str_append(&soap_headers, &soap_headers_z);
- smart_str_free(&soap_headers_z);
if (soap_version == SOAP_1_2) {
smart_str_append_const(&soap_headers,"Content-Type: application/soap+xml; charset=utf-8");
@@ -695,6 +699,7 @@ try_again:
} else {
add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", NULL, NULL TSRMLS_CC);
+ smart_str_free(&soap_headers_z);
return FALSE;
}
@@ -702,6 +707,7 @@ try_again:
php_stream_close(stream);
zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket"));
zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy"));
+ smart_str_free(&soap_headers_z);
return TRUE;
}
@@ -713,6 +719,7 @@ try_again:
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", "Error Fetching http headers", NULL, NULL TSRMLS_CC);
+ smart_str_free(&soap_headers_z);
return FALSE;
}
@@ -861,6 +868,7 @@ try_again:
if (http_msg) {
efree(http_msg);
}
+ smart_str_free(&soap_headers_z);
return FALSE;
}
@@ -1008,6 +1016,7 @@ try_again:
}
if (auth) efree(auth);
}
+ smart_str_free(&soap_headers_z);
/* Check and see if the server even sent a xml document */
content_type = get_http_header_value(http_headers,"Content-Type: ");