From: Daniel Stenberg Date: Fri, 13 Dec 2019 16:45:21 +0000 (+0100) Subject: multi: free sockhash on OOM X-Git-Tag: curl-7_68_0~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29ca9fc596c808c0ea716681af4743914f4003f5;p=thirdparty%2Fcurl.git multi: free sockhash on OOM This would otherwise leak memory in the error path. Detected by torture test 1540. Closes #4713 --- diff --git a/lib/multi.c b/lib/multi.c index cc11ea6176..6d819b4aaa 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 */ }