mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
Avoid a descriptor leak when binding the IPv6 DHT socket fails.
This commit is contained in:
@@ -294,8 +294,10 @@ rebind_ipv6(tr_bool force)
|
||||
sin6.sin6_port = htons(dht_port);
|
||||
rc = bind(s, (struct sockaddr*)&sin6, sizeof(sin6));
|
||||
|
||||
if(rc < 0)
|
||||
if(rc < 0) {
|
||||
close(s);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(dht6_socket < 0) {
|
||||
dht6_socket = s;
|
||||
|
||||
Reference in New Issue
Block a user