mirror of
https://github.com/moparisthebest/curl
synced 2024-11-16 14:35:03 -05: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:
parent
38ad9ea1b8
commit
29ca9fc596
@ -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 */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user