aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-12-13 17:45:21 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-12-13 22:46:46 +0100
commit29ca9fc596c808c0ea716681af4743914f4003f5 (patch)
treea0a3fb3e14c98090ece8c02ca8c559d5edf93e05
parent38ad9ea1b8bf81a36d6958c95238a9155dcb5e12 (diff)
multi: free sockhash on OOM
This would otherwise leak memory in the error path. Detected by torture test 1540. Closes #4713
-rwxr-xr-xlib/multi.c1
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 */
}