mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
connect: Close possibly leaking socket
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -335,6 +335,9 @@ socket_t ssh_connect_host_nonblocking(ssh_session session, const char *host,
|
||||
* connection, otherwise return the first address without error or error */
|
||||
if (s == -1) {
|
||||
s = first;
|
||||
} else if (s != first) {
|
||||
/* Clean up the saved socket */
|
||||
ssh_connect_socket_close(first);
|
||||
}
|
||||
|
||||
return s;
|
||||
|
||||
Reference in New Issue
Block a user