You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by mj...@apache.org on 2018/06/26 00:30:52 UTC

[18/22] guacamole-server git commit: GUACAMOLE-527: Plug some memory leaks before returning NULL.

GUACAMOLE-527: Plug some memory leaks before returning NULL.


Project: http://git-wip-us.apache.org/repos/asf/guacamole-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-server/commit/ba684962
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-server/tree/ba684962
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-server/diff/ba684962

Branch: refs/heads/master
Commit: ba684962b6f19e4ddd0ffa1435f0fe8563b978a9
Parents: f9379dc
Author: Nick Couchman <ni...@cotyinc.com>
Authored: Mon Jun 25 13:50:19 2018 -0400
Committer: Nick Couchman <ni...@cotyinc.com>
Committed: Mon Jun 25 13:50:19 2018 -0400

----------------------------------------------------------------------
 src/common-ssh/ssh.c | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/ba684962/src/common-ssh/ssh.c
----------------------------------------------------------------------
diff --git a/src/common-ssh/ssh.c b/src/common-ssh/ssh.c
index 4ed6d1d..1b13520 100644
--- a/src/common-ssh/ssh.c
+++ b/src/common-ssh/ssh.c
@@ -529,6 +529,8 @@ guac_common_ssh_session* guac_common_ssh_create_session(guac_client* client,
     if (!fingerprint) {
         guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR,
             "Failed to get fingerprint for host %s", hostname);
+        free(common_session);
+        close(fd);
         return NULL;
     }
 
@@ -551,6 +553,8 @@ guac_common_ssh_session* guac_common_ssh_create_session(guac_client* client,
             guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR,
                 "Host fingerprint did not match any provided known host keys. %s", err_msg);
 
+        free(common_session);
+        close(fd);
         return NULL;
     }