mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
tests: Free WNM allocations cleanly in wnm-fuzzer
Avoid a memory leak in fuzzer tests by calling wnm_deallocate_memory() before exiting since this fuzzing wrapper does not use full wpa_supplicant_cleanup(). Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
358141344a
commit
2dfe2ad6cb
@ -68,6 +68,12 @@ static int init_wpa(struct arg_ctx *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void deinit_wpa(struct arg_ctx *ctx)
|
||||||
|
{
|
||||||
|
wnm_deallocate_memory(&ctx->wpa_s);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
struct arg_ctx ctx;
|
struct arg_ctx ctx;
|
||||||
@ -99,6 +105,7 @@ int main(int argc, char *argv[])
|
|||||||
wpa_printf(MSG_DEBUG, "Starting eloop");
|
wpa_printf(MSG_DEBUG, "Starting eloop");
|
||||||
eloop_run();
|
eloop_run();
|
||||||
wpa_printf(MSG_DEBUG, "eloop done");
|
wpa_printf(MSG_DEBUG, "eloop done");
|
||||||
|
deinit_wpa(&ctx);
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
fail:
|
fail:
|
||||||
|
Loading…
Reference in New Issue
Block a user