client: Do not close the socket if it was set via options

Fixes #122

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Andreas Schneider
2022-04-19 16:22:12 +02:00
committed by Jakub Jelen
parent 442599f0d1
commit 4b20d7ad18

View File

@@ -720,7 +720,10 @@ ssh_disconnect(ssh_session session)
}
ssh_packet_send(session);
ssh_socket_close(session->socket);
/* Do not close the socket, if the fd was set via options. */
if (session->opts.fd == SSH_INVALID_SOCKET) {
ssh_socket_close(session->socket);
}
}
error: