aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-06-05 10:44:54 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-06-05 10:44:54 +0200
commitf5f8c0fc76890dcf3a6bd32db34e0c8b9110ee19 (patch)
tree924dbd74663af55d76d1774b00ebe866399de8e1
parentc4dbe3b863e0a0e63de16e2b215f3f22ea6ae730 (diff)
downloadlibssh-f5f8c0fc76890dcf3a6bd32db34e0c8b9110ee19.tar.gz
libssh-f5f8c0fc76890dcf3a6bd32db34e0c8b9110ee19.tar.xz
libssh-f5f8c0fc76890dcf3a6bd32db34e0c8b9110ee19.zip
knownhosts: Fix resource leak in ssh_known_hosts_parse_line()
CID 1391444 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/knownhosts.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/knownhosts.c b/src/knownhosts.c
index 2f13f73f..ea89a008 100644
--- a/src/knownhosts.c
+++ b/src/knownhosts.c
@@ -352,13 +352,15 @@ int ssh_known_hosts_parse_line(const char *hostname,
SAFE_FREE(known_host);
known_host = strdup(line);
if (known_host == NULL) {
- return SSH_ERROR;
+ rc = SSH_ERROR;
+ goto out;
}
p = strtok(known_host, " ");
if (p == NULL ) {
free(known_host);
- return SSH_ERROR;
+ rc = SSH_ERROR;
+ goto out;
}
e->unparsed = strdup(p);