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:
committed by
Andreas Schneider
parent
afd35fa98c
commit
099b914fd9
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user