aboutsummaryrefslogtreecommitdiff
path: root/src/bind.c
diff options
context:
space:
mode:
authorJon Simons <jon@jonsimons.org>2013-10-23 12:25:28 -0700
committerAndreas Schneider <asn@cryptomilk.org>2013-10-24 10:37:37 +0200
commit099b914fd9e3859d170a4f1bdb21ef0ba994b6f8 (patch)
tree65d4a3ec51a8592d606612745f416328bdc4e41a /src/bind.c
parentafd35fa98ce826191709d9ffd4943675b6b38589 (diff)
downloadlibssh-099b914fd9e3859d170a4f1bdb21ef0ba994b6f8.tar.gz
libssh-099b914fd9e3859d170a4f1bdb21ef0ba994b6f8.tar.xz
libssh-099b914fd9e3859d170a4f1bdb21ef0ba994b6f8.zip
bind: fix leak in ssh_bind_accept error path
Use 'ssh_socket_free' to cleanup if 'ssh_bind_accept_fd' fails, to be sure to free the ssh_socket in/out buffers.
Diffstat (limited to 'src/bind.c')
-rw-r--r--src/bind.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/bind.c b/src/bind.c
index e4c9327e..8132e3e9 100644
--- a/src/bind.c
+++ b/src/bind.c
@@ -454,8 +454,7 @@ int ssh_bind_accept(ssh_bind sshbind, ssh_session session) {
#else
close(fd);
#endif
- if (session->socket)
- ssh_socket_close(session->socket);
+ ssh_socket_free(session->socket);
}
return rc;
}