mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-27 13:21:11 +03:00
knownhosts: Fix memory leak
CID 1393774 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -310,12 +310,14 @@ struct ssh_list *ssh_known_hosts_get_algorithms(ssh_session session)
|
||||
|
||||
list = ssh_list_new();
|
||||
if (list == NULL) {
|
||||
SAFE_FREE(host_port);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rc = ssh_known_hosts_read_entries(host_port,
|
||||
session->opts.knownhosts,
|
||||
&entry_list);
|
||||
SAFE_FREE(host_port);
|
||||
if (rc != 0) {
|
||||
ssh_list_free(list);
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user