From ed009402756f602a2023e0dcdb19d3c981b8ccf8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 13 Dec 2019 17:45:21 +0100 Subject: multi: free sockhash on OOM This would otherwise leak memory in the error path. Detected by torture test. --- lib/multi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/multi.c b/lib/multi.c index cc11ea617..6d819b4aa 100755 --- a/lib/multi.c +++ b/lib/multi.c @@ -260,6 +260,7 @@ static struct Curl_sh_entry *sh_addentry(struct curl_hash *sh, /* make/add new hash entry */ if(!Curl_hash_add(sh, (char *)&s, sizeof(curl_socket_t), check)) { + Curl_hash_destroy(&check->transfers); free(check); return NULL; /* major failure */ } -- cgit v1.2.1