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
This commit is contained in:
Aris Adamantiadis
2008-06-30 22:28:11 +00:00
parent 5758188467
commit d477025000
4 changed files with 35 additions and 1 deletions

View File

@@ -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);