mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +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
|
#else
|
||||||
close(fd);
|
close(fd);
|
||||||
#endif
|
#endif
|
||||||
if (session->socket)
|
ssh_socket_free(session->socket);
|
||||||
ssh_socket_close(session->socket);
|
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user