aboutsummaryrefslogtreecommitdiff
path: root/src/kex.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2014-02-05 08:07:45 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2014-02-05 08:07:45 +0100
commitc28ad814d0a7a5279a31feea91aaa83762270ff3 (patch)
treed30bf0c55e86ec93b3de1e99638308f6b98b7c93 /src/kex.c
parentfdc660f313a1e8d692c1131d8ac35e83288c0d85 (diff)
downloadlibssh-c28ad814d0a7a5279a31feea91aaa83762270ff3.tar.gz
libssh-c28ad814d0a7a5279a31feea91aaa83762270ff3.tar.xz
libssh-c28ad814d0a7a5279a31feea91aaa83762270ff3.zip
knownhosts: resolve leaks found by coverity
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 6433ee6f..e1e3697c 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){