From: Jouni Malinen Date: Fri, 24 May 2019 13:30:19 +0000 (+0300) Subject: tests: Free WNM allocations cleanly in wnm-fuzzer X-Git-Tag: hostap_2_9~276 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2dfe2ad6cb6d81f2ccf3a227029fa2b0e2e841d2;p=thirdparty%2Fhostap.git 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 --- diff --git a/tests/wnm-fuzzer/wnm-fuzzer.c b/tests/wnm-fuzzer/wnm-fuzzer.c index de74b6bf9..2517b5c85 100644 --- a/tests/wnm-fuzzer/wnm-fuzzer.c +++ b/tests/wnm-fuzzer/wnm-fuzzer.c @@ -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[]) { struct arg_ctx ctx; @@ -99,6 +105,7 @@ int main(int argc, char *argv[]) wpa_printf(MSG_DEBUG, "Starting eloop"); eloop_run(); wpa_printf(MSG_DEBUG, "eloop done"); + deinit_wpa(&ctx); ret = 0; fail: