From 0a4e27d5832a6a2d0fdaff4a169d0c216b37eeee Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sun, 18 Feb 2001 12:36:39 +1100 Subject: - (djm) Close listen_sock on bind() failures. Patch from Arkadiusz Miskiewicz --- sshd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sshd.c') 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; } -- cgit v1.2.3