Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/incubator-guacamole-server/pull/114#discussion_r141411562
--- Diff: 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);
--- End diff --
The addresses returned by a call to `getaddrinfo()` actually have to be
freed by a call to `freeaddrinfo()`:
https://github.com/apache/incubator-guacamole-server/blob/afb554a0149391693615226060f567a5f2ef7d49/src/common-ssh/ssh.c#L487
Since the result of calling `getaddrinfo()` is a dynamically-allocated
linked list, invoking `free()` on the returned list will not necessarily free
the entire list, but likely only a single element of that list.
---