From 329171a9502b78208c54e22c912fb35d5d1634e9 Mon Sep 17 00:00:00 2001 From: ycaibb Date: Fri, 10 Sep 2021 20:44:46 +0800 Subject: [PATCH] GUACAMOLE-1416: Fix unreleased the lock in the ssh_client_thread GUACAMOLE-1416: Fix unreleased the lock ssh_client->term_channel_lock in the ssh_client_thread. --- src/protocols/ssh/ssh.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/protocols/ssh/ssh.c b/src/protocols/ssh/ssh.c index 81fb0855..0a108eda 100644 --- a/src/protocols/ssh/ssh.c +++ b/src/protocols/ssh/ssh.c @@ -438,8 +438,10 @@ void* ssh_client_thread(void* data) { /* Send keepalive at configured interval */ if (settings->server_alive_interval > 0) { timeout = 0; - if (libssh2_keepalive_send(ssh_client->session->session, &timeout) > 0) + if (libssh2_keepalive_send(ssh_client->session->session, &timeout) > 0) { + pthread_mutex_unlock(&(ssh_client->term_channel_lock)); break; + } timeout *= 1000; } /* If keepalive is not configured, sleep for the default of 1 second */