From fb8a2766da914245b8af42b03d33320f4b786157 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 26 Feb 2017 15:02:48 -0800 Subject: [PATCH] GUACAMOLE-194: Free SSH user for VNC+SFTP and RDP+SFTP only within client free. --- src/protocols/rdp/rdp.c | 4 ---- src/protocols/vnc/vnc.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/src/protocols/rdp/rdp.c b/src/protocols/rdp/rdp.c index 3cd2f68c..96dc9412 100644 --- a/src/protocols/rdp/rdp.c +++ b/src/protocols/rdp/rdp.c @@ -956,7 +956,6 @@ void* guac_rdp_client_thread(void* data) { if (guac_common_ssh_user_import_key(rdp_client->sftp_user, settings->sftp_private_key, settings->sftp_passphrase)) { - guac_common_ssh_destroy_user(rdp_client->sftp_user); guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Private key unreadable."); return NULL; @@ -983,7 +982,6 @@ void* guac_rdp_client_thread(void* data) { /* Fail if SSH connection does not succeed */ if (rdp_client->sftp_session == NULL) { /* Already aborted within guac_common_ssh_create_session() */ - guac_common_ssh_destroy_user(rdp_client->sftp_user); return NULL; } @@ -999,8 +997,6 @@ void* guac_rdp_client_thread(void* data) { /* Abort if SFTP connection fails */ if (rdp_client->sftp_filesystem == NULL) { - guac_common_ssh_destroy_session(rdp_client->sftp_session); - guac_common_ssh_destroy_user(rdp_client->sftp_user); guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_UNAVAILABLE, "SFTP connection failed."); return NULL; diff --git a/src/protocols/vnc/vnc.c b/src/protocols/vnc/vnc.c index 611c84f4..94941c63 100644 --- a/src/protocols/vnc/vnc.c +++ b/src/protocols/vnc/vnc.c @@ -243,7 +243,6 @@ void* guac_vnc_client_thread(void* data) { if (guac_common_ssh_user_import_key(vnc_client->sftp_user, settings->sftp_private_key, settings->sftp_passphrase)) { - guac_common_ssh_destroy_user(vnc_client->sftp_user); guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Private key unreadable."); return NULL; @@ -267,7 +266,6 @@ void* guac_vnc_client_thread(void* data) { /* Fail if SSH connection does not succeed */ if (vnc_client->sftp_session == NULL) { /* Already aborted within guac_common_ssh_create_session() */ - guac_common_ssh_destroy_user(vnc_client->sftp_user); return NULL; } @@ -283,8 +281,6 @@ void* guac_vnc_client_thread(void* data) { /* Abort if SFTP connection fails */ if (vnc_client->sftp_filesystem == NULL) { - guac_common_ssh_destroy_session(vnc_client->sftp_session); - guac_common_ssh_destroy_user(vnc_client->sftp_user); guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR, "SFTP connection failed."); return NULL;