mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
knownhosts: Fix resource leak in ssh_known_hosts_read_entries()
CID 1391449 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -190,6 +190,7 @@ static int ssh_known_hosts_read_entries(const char *match,
|
||||
|
||||
entry_list = ssh_list_new();
|
||||
if (entry_list == NULL) {
|
||||
fclose(fp);
|
||||
return SSH_ERROR;
|
||||
}
|
||||
|
||||
@@ -225,9 +226,11 @@ static int ssh_known_hosts_read_entries(const char *match,
|
||||
|
||||
*entries = entry_list;
|
||||
|
||||
fclose(fp);
|
||||
return SSH_OK;
|
||||
error:
|
||||
ssh_list_free(entry_list);
|
||||
fclose(fp);
|
||||
return SSH_ERROR;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user