From 2fa146838648bbc4c48066d584d669739f41799f Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 21 Jul 2014 11:23:36 -0700 Subject: [PATCH] GUAC-779: Terminal channel mutex must exist before terminal channel. --- src/protocols/ssh/ssh_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/protocols/ssh/ssh_client.c b/src/protocols/ssh/ssh_client.c index 9f082e7d..968ffd95 100644 --- a/src/protocols/ssh/ssh_client.c +++ b/src/protocols/ssh/ssh_client.c @@ -409,6 +409,8 @@ void* ssh_client_thread(void* data) { return NULL; } + pthread_mutex_init(&client_data->term_channel_lock, NULL); + /* Open channel for terminal */ client_data->term_channel = libssh2_channel_open_session(client_data->session); if (client_data->term_channel == NULL) { @@ -477,8 +479,6 @@ void* ssh_client_thread(void* data) { /* Logged in */ guac_client_log_info(client, "SSH connection successful."); - pthread_mutex_init(&client_data->term_channel_lock, NULL); - /* Start input thread */ if (pthread_create(&(input_thread), NULL, ssh_input_thread, (void*) client)) { guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Unable to start input thread");