]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix ap-mgmt-fuzzer exit to free memory
authorJouni Malinen <jouni@codeaurora.org>
Fri, 24 May 2019 22:34:58 +0000 (01:34 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 24 May 2019 22:34:58 +0000 (01:34 +0300)
This fuzzing wrapper does not go through full hostapd_clean_iface() call
to free memory, so call ap_list_deinit() to avoid reporting memory leaks
from added AP list entries. This case could not be hit with
hostapd/wpa_supplicant since they perform full interface deinit on
interface removal.

Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14928
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/ap-mgmt-fuzzer/ap-mgmt-fuzzer.c

index 2adb332e74c8f0abf3856df55d8e787c0f109cd8..9d61b6bcc76d5bf4d85c53cb9dd4aa4aabbcba62 100644 (file)
@@ -14,6 +14,7 @@
 #include "ap/hw_features.h"
 #include "ap/ieee802_11.h"
 #include "ap/sta_info.h"
+#include "ap/ap_list.h"
 
 
 const struct wpa_driver_ops *const wpa_drivers[] =
@@ -185,6 +186,7 @@ int main(int argc, char *argv[])
        ret = 0;
 fail:
        hostapd_config_free(ctx.hapd.iconf);
+       ap_list_deinit(&ctx.iface);
        eloop_destroy();
        os_program_deinit();