From: Daniel Gustafsson Date: Thu, 13 Sep 2018 08:06:05 +0000 (+0200) Subject: ntlm_wb: Fix memory leaks in ntlm_wb_response X-Git-Tag: curl-7_62_0~185 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=60ed8d72760b911ff8f56e02acc083f79b567af6;p=thirdparty%2Fcurl.git 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 --- diff --git a/lib/curl_ntlm_wb.c b/lib/curl_ntlm_wb.c index baf579ef7b..949c7fa176 100644 --- a/lib/curl_ntlm_wb.c +++ b/lib/curl_ntlm_wb.c @@ -295,6 +295,7 @@ static CURLcode ntlm_wb_response(struct connectdata *conn, if(len_out > MAX_NTLM_WB_RESPONSE) { failf(conn->data, "too large ntlm_wb response!"); + free(buf); return CURLE_OUT_OF_MEMORY; }