aboutsummaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2013-03-24 04:47:57 +0100
committerYang Tse <yangsita@gmail.com>2013-03-25 03:32:47 +0100
commitacafe9c160e6c299d48d72ab93fdb7abfcbf3ed2 (patch)
treec3b87a727a0360917dc545b631cfab43b0aed623 /lib/http.c
parent8ec2cb5544b86306b702484ea785b6b9596562ab (diff)
NTLM: fix several NTLM code paths memory leaks
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/http.c b/lib/http.c
index 0ba11133f..f4b7a48e7 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -1739,8 +1739,11 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
conn->bits.authneg = FALSE;
Curl_safefree(conn->allocptr.ref);
- if(data->change.referer && !Curl_checkheaders(data, "Referer:"))
+ if(data->change.referer && !Curl_checkheaders(data, "Referer:")) {
conn->allocptr.ref = aprintf("Referer: %s\r\n", data->change.referer);
+ if(!conn->allocptr.ref)
+ return CURLE_OUT_OF_MEMORY;
+ }
else
conn->allocptr.ref = NULL;