]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ntlm_wb: Fix memory leaks in ntlm_wb_response
authorDaniel Gustafsson <daniel@yesql.se>
Thu, 13 Sep 2018 08:06:05 +0000 (10:06 +0200)
committerDaniel Gustafsson <daniel@yesql.se>
Thu, 13 Sep 2018 08:06:05 +0000 (10:06 +0200)
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>
lib/curl_ntlm_wb.c

index baf579ef7b7bbb5dbe2729d4cf382e3f0e53ec4b..949c7fa1766665f62f8075af896cc0eba4d40aea 100644 (file)
@@ -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;
     }