diff options
Diffstat (limited to 'libssh/kex.c')
-rw-r--r-- | libssh/kex.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libssh/kex.c b/libssh/kex.c index e325aeda..f26c4bd1 100644 --- a/libssh/kex.c +++ b/libssh/kex.c @@ -293,8 +293,13 @@ int set_kex(SSH_SESSION *session){ leave_function(); return -1; } else { - if(i>=SSH_LANG_C_S && !client->methods[i]) - client->methods[i]=strdup(""); // we can safely do that for languages + if ((i >= SSH_LANG_C_S) && (client->methods[i] == NULL)) { + /* we can safely do that for languages */ + client->methods[i] = strdup(""); + if (client->methods[i] == NULL) { + return -1; + } + } } } leave_function(); |