aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2012-03-16 20:11:22 +0100
committerYang Tse <yangsita@gmail.com>2012-03-16 20:11:22 +0100
commit0c8e36c18afc18b2de4c345c70828cf545a8715b (patch)
treebc6f0201b07744c749a83976e62c998ef255f38d /lib
parent862bb7bade597eb73128af5d875788c150ca8fcb (diff)
http_proxy.c: fix OOM handling
Diffstat (limited to 'lib')
-rw-r--r--lib/http_proxy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/http_proxy.c b/lib/http_proxy.c
index b12d37011..e2d3869fd 100644
--- a/lib/http_proxy.c
+++ b/lib/http_proxy.c
@@ -128,12 +128,15 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
aprintf("%s%s%s:%hu", conn->bits.ipv6_ip?"[":"",
hostname, conn->bits.ipv6_ip?"]":"",
remote_port);
- if(!hostheader)
+ if(!hostheader) {
+ free(req_buffer);
return CURLE_OUT_OF_MEMORY;
+ }
if(!Curl_checkheaders(data, "Host:")) {
host = aprintf("Host: %s\r\n", hostheader);
if(!host) {
+ free(hostheader);
free(req_buffer);
return CURLE_OUT_OF_MEMORY;
}