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();
|
list = ssh_list_new();
|
||||||
if (list == NULL) {
|
if (list == NULL) {
|
||||||
|
SAFE_FREE(host_port);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = ssh_known_hosts_read_entries(host_port,
|
rc = ssh_known_hosts_read_entries(host_port,
|
||||||
session->opts.knownhosts,
|
session->opts.knownhosts,
|
||||||
&entry_list);
|
&entry_list);
|
||||||
|
SAFE_FREE(host_port);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
ssh_list_free(list);
|
ssh_list_free(list);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user