1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-24 19:37:48 +03:00

tests: Fix memory leak in torture_knownhosts_read_file()

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-08-08 09:44:49 +02:00
parent 460026459b
commit 8c11367410

View File

@@ -229,6 +229,15 @@ static void torture_knownhosts_read_file(void **state)
type = ssh_key_type(entry->publickey);
assert_int_equal(type, SSH_KEYTYPE_ED25519);
}
it = ssh_list_get_iterator(entry_list);
for (;it != NULL; it = it->next) {
struct ssh_knownhosts_entry *entry = NULL;
entry = ssh_iterator_value(struct ssh_knownhosts_entry *, it);
SSH_KNOWNHOSTS_ENTRY_FREE(entry);
}
ssh_list_free(entry_list);
}
static void torture_knownhosts_host_exists(void **state)