summaryrefslogtreecommitdiffstats
path: root/libssh/server.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2008-06-30 22:28:11 +0000
committerAris Adamantiadis <aris@0xbadc0de.be>2008-06-30 22:28:11 +0000
commitd477025000c4d6717f9501cc8d382eed06fbe868 (patch)
tree449d1758108d4d7ea969b04df2ce0e6202ee705b /libssh/server.c
parent5758188467194aa04ad854b77167ec360bdac463 (diff)
downloadlibssh-d477025000c4d6717f9501cc8d382eed06fbe868.tar.gz
libssh-d477025000c4d6717f9501cc8d382eed06fbe868.tar.xz
libssh-d477025000c4d6717f9501cc8d382eed06fbe868.zip
fix bug 0000015 about memory leak in server path
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@180 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/server.c')
-rw-r--r--libssh/server.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libssh/server.c b/libssh/server.c
index 58fbb615..538ec80a 100644
--- a/libssh/server.c
+++ b/libssh/server.c
@@ -163,6 +163,7 @@ SSH_SESSION *ssh_bind_accept(SSH_BIND *ssh_bind){
session=ssh_new();
session->server=1;
session->version=2;
+ ssh_socket_free(session->socket);
session->socket=ssh_socket_new(session);
ssh_socket_set_fd(session->socket,fd);
session->options=ssh_options_copy(ssh_bind->options);
@@ -175,6 +176,8 @@ void ssh_bind_free(SSH_BIND *ssh_bind){
if(ssh_bind->bindfd>=0)
close(ssh_bind->bindfd);
ssh_bind->bindfd=-1;
+ if(ssh_bind->options)
+ ssh_options_free(ssh_bind->options);
free(ssh_bind);
}
@@ -223,6 +226,7 @@ static int dh_handshake_server(SSH_SESSION *session){
return -1;
}
dh_import_e(session,e);
+ free(e);
dh_generate_y(session);
dh_generate_f(session);
f=dh_get_f(session);