From e4dd8de4f1383bf6235822acb933175172942693 Mon Sep 17 00:00:00 2001 From: Nick Couchman Date: Wed, 27 Sep 2017 13:02:41 -0400 Subject: [PATCH 1/2] GUACAMOLE-398: Fix memory leak identified by Coverity in common ssh code. --- src/common-ssh/ssh.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common-ssh/ssh.c b/src/common-ssh/ssh.c index d3e1e42e..212b21f0 100644 --- a/src/common-ssh/ssh.c +++ b/src/common-ssh/ssh.c @@ -457,6 +457,7 @@ guac_common_ssh_session* guac_common_ssh_create_session(guac_client* client, if (fd < 0) { guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Unable to create socket: %s", strerror(errno)); + free(addresses); return NULL; } From 9200bc789fbd9da1a35402a71b2f783a25b8064a Mon Sep 17 00:00:00 2001 From: Nick Couchman Date: Wed, 27 Sep 2017 13:24:58 -0400 Subject: [PATCH 2/2] GUACAMOLE-398: Use freeaddrinfo() instead of free() on the linked list. --- src/common-ssh/ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common-ssh/ssh.c b/src/common-ssh/ssh.c index 212b21f0..5ea6feab 100644 --- a/src/common-ssh/ssh.c +++ b/src/common-ssh/ssh.c @@ -457,7 +457,7 @@ guac_common_ssh_session* guac_common_ssh_create_session(guac_client* client, if (fd < 0) { guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Unable to create socket: %s", strerror(errno)); - free(addresses); + freeaddrinfo(addresses); return NULL; }