diff options
author | Warner Losh <imp@FreeBSD.org> | 2017-12-28 05:34:24 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2017-12-28 05:34:24 +0000 |
commit | 5539da566e69bdc04d71fce6e2279c6836f2ad3b (patch) | |
tree | a3bca7ed5dcf888cce59ab7bcf596cecac0e9fbc /sbin/routed/main.c | |
parent | cd4461513c6697109e1ffeee190317e38e320297 (diff) | |
download | src-5539da566e69bdc04d71fce6e2279c6836f2ad3b.tar.gz src-5539da566e69bdc04d71fce6e2279c6836f2ad3b.zip |
When bind fails, make sure we closed the socket we tried to bind the
address to.
CID: 978244
Notes
Notes:
svn path=/head/; revision=327276
Diffstat (limited to 'sbin/routed/main.c')
-rw-r--r-- | sbin/routed/main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sbin/routed/main.c b/sbin/routed/main.c index 45b150653041..c4f9e56065e6 100644 --- a/sbin/routed/main.c +++ b/sbin/routed/main.c @@ -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"); |