diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-12-13 17:45:21 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-12-13 17:45:21 +0100 |
commit | ed009402756f602a2023e0dcdb19d3c981b8ccf8 (patch) | |
tree | 02af55c0cd3b316545887dcdb41384b4e46b85bc | |
parent | ec3758b95f98954b43af6367e7f27baee0d9f307 (diff) | |
download | curl-bagder/mutli-sockhash-leak.tar.gz |
multi: free sockhash on OOMbagder/mutli-sockhash-leak
This would otherwise leak memory in the error path.
Detected by torture test.
-rwxr-xr-x | lib/multi.c | 1 |
1 files changed, 1 insertions, 0 deletions
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 */ } |