Avoid memory leaks from the server_auth_kbdint

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
This commit is contained in:
Jakub Jelen
2023-04-28 10:55:15 +02:00
parent 4278499e26
commit e4bf3b97b4
5 changed files with 63 additions and 41 deletions

View File

@@ -1114,6 +1114,16 @@ void torture_setup_sshd_server(void **state, bool pam)
assert_int_equal(rc, 0);
}
void torture_free_state(struct torture_state *s)
{
free(s->srv_config);
free(s->socket_dir);
free(s->pcap_file);
free(s->srv_pidfile);
free(s->srv_additional_config);
free(s);
}
void torture_teardown_socket_dir(void **state)
{
struct torture_state *s = *state;
@@ -1137,13 +1147,7 @@ void torture_teardown_socket_dir(void **state)
}
s->plain_pcap = NULL;
#endif /* WITH_PCAP */
free(s->srv_config);
free(s->socket_dir);
free(s->pcap_file);
free(s->srv_pidfile);
free(s->srv_additional_config);
free(s);
torture_free_state(s);
}
static int