diff --git a/ChangeLog b/ChangeLog index 404423a5c..4450f48ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ stevesk - (djm) Fix my breaking of cygwin builds, Patch from Corinna Vinschen and myself. + - (djm) Close listen_sock on bind() failures. Patch from Arkadiusz + Miskiewicz 20010217 - (bal) OpenBSD Sync: @@ -4012,4 +4014,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.785 2001/02/18 01:30:55 djm Exp $ +$Id: ChangeLog,v 1.786 2001/02/18 01:36:39 djm Exp $ diff --git a/sshd.c b/sshd.c index 86bfb6519..be046ea65 100644 --- a/sshd.c +++ b/sshd.c @@ -849,10 +849,10 @@ main(int ac, char **av) debug("Bind to port %s on %s.", strport, ntop); /* Bind the socket to the desired port. */ - if ((bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) && - (!ai->ai_next)) { - error("Bind to port %s on %s failed: %.200s.", - strport, ntop, strerror(errno)); + if (bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) { + if (!ai->ai_next) + error("Bind to port %s on %s failed: %.200s.", + strport, ntop, strerror(errno)); close(listen_sock); continue; }