Author: imp
Date: Thu Dec 28 05:34:24 2017
New Revision: 327276
URL: https://svnweb.freebsd.org/changeset/base/327276

Log:
  When bind fails, make sure we closed the socket we tried to bind the
  address to.
  
  CID: 978244

Modified:
  head/sbin/routed/main.c

Modified: head/sbin/routed/main.c
==============================================================================
--- head/sbin/routed/main.c     Thu Dec 28 05:34:19 2017        (r327275)
+++ head/sbin/routed/main.c     Thu Dec 28 05:34:24 2017        (r327276)
@@ -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");
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to