1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

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.
This commit is contained in:
Jon Simons
2013-10-23 12:25:28 -07:00
committed by Andreas Schneider
parent afd35fa98c
commit 099b914fd9

View File

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