NTLM: fix several NTLM code paths memory leaks

This commit is contained in:
Yang Tse 2013-03-24 04:47:57 +01:00
parent 8ec2cb5544
commit acafe9c160
3 changed files with 16 additions and 13 deletions

View file

@ -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;