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 | |
parent | 2deb3f64f60d5fe0331f87416d99536b220d7a4f (diff) |
- (djm) Close listen_sock on bind() failures. Patch from Arkadiusz
Miskiewicz <misiek@pld.ORG.PL>
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | sshd.c | 8 |
2 files changed, 7 insertions, 5 deletions
@@ -5,6 +5,8 @@ | |||
5 | stevesk | 5 | stevesk |
6 | - (djm) Fix my breaking of cygwin builds, Patch from Corinna Vinschen | 6 | - (djm) Fix my breaking of cygwin builds, Patch from Corinna Vinschen |
7 | <vinschen@redhat.com> and myself. | 7 | <vinschen@redhat.com> and myself. |
8 | - (djm) Close listen_sock on bind() failures. Patch from Arkadiusz | ||
9 | Miskiewicz <misiek@pld.ORG.PL> | ||
8 | 10 | ||
9 | 20010217 | 11 | 20010217 |
10 | - (bal) OpenBSD Sync: | 12 | - (bal) OpenBSD Sync: |
@@ -4012,4 +4014,4 @@ | |||
4012 | - Wrote replacements for strlcpy and mkdtemp | 4014 | - Wrote replacements for strlcpy and mkdtemp |
4013 | - Released 1.0pre1 | 4015 | - Released 1.0pre1 |
4014 | 4016 | ||
4015 | $Id: ChangeLog,v 1.785 2001/02/18 01:30:55 djm Exp $ | 4017 | $Id: ChangeLog,v 1.786 2001/02/18 01:36:39 djm Exp $ |
@@ -849,10 +849,10 @@ main(int ac, char **av) | |||
849 | debug("Bind to port %s on %s.", strport, ntop); | 849 | debug("Bind to port %s on %s.", strport, ntop); |
850 | 850 | ||
851 | /* Bind the socket to the desired port. */ | 851 | /* Bind the socket to the desired port. */ |
852 | if ((bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) && | 852 | if (bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) { |
853 | (!ai->ai_next)) { | 853 | if (!ai->ai_next) |
854 | error("Bind to port %s on %s failed: %.200s.", | 854 | error("Bind to port %s on %s failed: %.200s.", |
855 | strport, ntop, strerror(errno)); | 855 | strport, ntop, strerror(errno)); |
856 | close(listen_sock); | 856 | close(listen_sock); |
857 | continue; | 857 | continue; |
858 | } | 858 | } |