aboutsummaryrefslogtreecommitdiff
path: root/src/kex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kex.c')
-rw-r--r--src/kex.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/kex.c b/src/kex.c
index 8bf66231..f19beb81 100644
--- a/src/kex.c
+++ b/src/kex.c
@@ -390,8 +390,10 @@ static char *ssh_client_select_hostkeys(ssh_session session){
int needcoma=0;
methods = ssh_knownhosts_algorithms(session);
- if (methods == NULL || methods[0] == NULL)
+ if (methods == NULL || methods[0] == NULL){
+ SAFE_FREE(methods);
return NULL;
+ }
for (i=0;preferred_hostkeys[i] != NULL; ++i){
for (j=0; methods[j] != NULL; ++j){