1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

multi: free sockhash on OOM

This would otherwise leak memory in the error path.

Detected by torture test 1540.

Closes #4713
This commit is contained in:
Daniel Stenberg 2019-12-13 17:45:21 +01:00
parent 38ad9ea1b8
commit 29ca9fc596
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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 */
}