GUAC-1389: Simply logic surrounding freeaddrinfo().

This commit is contained in:
Michael Jumper 2016-03-02 20:09:07 -08:00
parent c9346014df
commit b3b5a65923

View File

@ -445,18 +445,17 @@ guac_common_ssh_session* guac_common_ssh_create_session(guac_client* client,
}
/* Free addrinfo */
freeaddrinfo(addresses);
/* If unable to connect to anything, fail */
if (current_address == NULL) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR,
"Unable to connect to any addresses.");
freeaddrinfo(addresses);
close(fd);
return NULL;
}
/* Free addrinfo */
freeaddrinfo(addresses);
/* Allocate new session */
guac_common_ssh_session* common_session =
malloc(sizeof(guac_common_ssh_session));