When bind fails, make sure we closed the socket we tried to bind the
address to. CID: 978244
This commit is contained in:
parent
cd4461513c
commit
5539da566e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327276
@ -667,6 +667,7 @@ get_rip_sock(naddr addr,
|
|||||||
if (bind(s, (struct sockaddr *)&rsin, sizeof(rsin)) < 0) {
|
if (bind(s, (struct sockaddr *)&rsin, sizeof(rsin)) < 0) {
|
||||||
if (serious)
|
if (serious)
|
||||||
BADERR(errno != EADDRINUSE, "bind(rip_sock)");
|
BADERR(errno != EADDRINUSE, "bind(rip_sock)");
|
||||||
|
close(s);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
fix_sock(s,"rip_sock");
|
fix_sock(s,"rip_sock");
|
||||||
|
Loading…
Reference in New Issue
Block a user