diff options
author | Damien Miller <djm@mindrot.org> | 2001-02-18 12:36:39 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2001-02-18 12:36:39 +1100 |
commit | 0a4e27d5832a6a2d0fdaff4a169d0c216b37eeee (patch) | |
tree | 03cd340d5e07fb18625dbaefedba9c42fc2bad2e /sshd.c | |
parent | 2deb3f64f60d5fe0331f87416d99536b220d7a4f (diff) | |
download | openssh-git-0a4e27d5832a6a2d0fdaff4a169d0c216b37eeee.tar.gz |
- (djm) Close listen_sock on bind() failures. Patch from Arkadiusz
Miskiewicz <misiek@pld.ORG.PL>
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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; } |