- (djm) Close listen_sock on bind() failures. Patch from Arkadiusz

Miskiewicz <misiek@pld.ORG.PL>
This commit is contained in:
Damien Miller 2001-02-18 12:36:39 +11:00
parent 2deb3f64f6
commit 0a4e27d583
2 changed files with 7 additions and 5 deletions

View File

@ -5,6 +5,8 @@
stevesk stevesk
- (djm) Fix my breaking of cygwin builds, Patch from Corinna Vinschen - (djm) Fix my breaking of cygwin builds, Patch from Corinna Vinschen
<vinschen@redhat.com> and myself. <vinschen@redhat.com> and myself.
- (djm) Close listen_sock on bind() failures. Patch from Arkadiusz
Miskiewicz <misiek@pld.ORG.PL>
20010217 20010217
- (bal) OpenBSD Sync: - (bal) OpenBSD Sync:
@ -4012,4 +4014,4 @@
- Wrote replacements for strlcpy and mkdtemp - Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1 - 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 $

8
sshd.c
View File

@ -849,10 +849,10 @@ main(int ac, char **av)
debug("Bind to port %s on %s.", strport, ntop); debug("Bind to port %s on %s.", strport, ntop);
/* Bind the socket to the desired port. */ /* Bind the socket to the desired port. */
if ((bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) && if (bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) {
(!ai->ai_next)) { if (!ai->ai_next)
error("Bind to port %s on %s failed: %.200s.", error("Bind to port %s on %s failed: %.200s.",
strport, ntop, strerror(errno)); strport, ntop, strerror(errno));
close(listen_sock); close(listen_sock);
continue; continue;
} }