When bind fails, make sure we closed the socket we tried to bind the

address to.

CID: 978244
This commit is contained in:
imp 2017-12-28 05:34:24 +00:00
parent 47266d9140
commit 7c3ff08282

View File

@ -667,6 +667,7 @@ get_rip_sock(naddr addr,
if (bind(s, (struct sockaddr *)&rsin, sizeof(rsin)) < 0) {
if (serious)
BADERR(errno != EADDRINUSE, "bind(rip_sock)");
close(s);
return -1;
}
fix_sock(s,"rip_sock");