aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2012-10-08 21:19:34 +0200
committerAndreas Schneider <asn@cryptomilk.org>2012-10-12 08:07:02 +0200
commitba220adb841829711452c95b4d70f1a4c93e8dfe (patch)
tree216fee59e346c829e1db43c5efa5db99ed5df29a
parent802e4133cb58ac2519604abc92de08b4bf525635 (diff)
downloadlibssh-ba220adb841829711452c95b4d70f1a4c93e8dfe.tar.gz
libssh-ba220adb841829711452c95b4d70f1a4c93e8dfe.tar.xz
libssh-ba220adb841829711452c95b4d70f1a4c93e8dfe.zip
connect: Don't leak the file descriptor on error.
Found by Coverity.
-rw-r--r--src/connect.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/connect.c b/src/connect.c
index 36cbb638..35453c73 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -247,6 +247,7 @@ socket_t ssh_connect_host(ssh_session session, const char *host,
"Failed to resolve bind address %s (%s)",
bind_addr,
gai_strerror(rc));
+ close(s);
leave_function();
return -1;
}