mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
knownhosts: Fix resource leak in ssh_known_hosts_parse_line()
CID 1391444 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user