1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-17 06:55:02 -05:00

ntlm_wb: Fix memory leaks in ntlm_wb_response

When erroring out on a request being too large, the existing buffer was
leaked. Fix by explicitly freeing on the way out.

Closes #2966
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
This commit is contained in:
Daniel Gustafsson 2018-09-13 10:06:05 +02:00
parent 66b3c186fa
commit 60ed8d7276

View File

@ -295,6 +295,7 @@ static CURLcode ntlm_wb_response(struct connectdata *conn,
if(len_out > MAX_NTLM_WB_RESPONSE) { if(len_out > MAX_NTLM_WB_RESPONSE) {
failf(conn->data, "too large ntlm_wb response!"); failf(conn->data, "too large ntlm_wb response!");
free(buf);
return CURLE_OUT_OF_MEMORY; return CURLE_OUT_OF_MEMORY;
} }