]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
trace: Free symbols on program exit
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 16 Feb 2016 12:10:29 +0000 (14:10 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 16 Feb 2016 12:10:29 +0000 (14:10 +0200)
This makes valgrind memleak checks with CONFIG_WPA_TRACE=y somewhat
cleaner.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/utils/os_unix.c
src/utils/trace.c
src/utils/trace.h

index 8f8dc5b21a394c9e30d604133e41683f103d2358..0118d98162337d4b15bd417a91a7711223f5d005 100644 (file)
@@ -372,6 +372,7 @@ void os_program_deinit(void)
        if (total)
                wpa_printf(MSG_INFO, "MEMLEAK: total %lu bytes",
                           (unsigned long) total);
+       wpa_trace_deinit();
 #endif /* WPA_TRACE */
 }
 
index 8484d277d24b66c439e71d0834b0f5fd5a31e6a3..d98c4b04c490dde67408877b9303ebf41e53399e 100644 (file)
@@ -366,4 +366,11 @@ void wpa_trace_check_ref(const void *addr)
        }
 }
 
+
+void wpa_trace_deinit(void)
+{
+       free(syms);
+       syms = NULL;
+}
+
 #endif /* WPA_TRACE */
index 43ed86c199786a5d401628e60045eff51ec08d4a..d1636de07728188187fafb1e4e58cbf216bb33c6 100644 (file)
@@ -66,4 +66,6 @@ void wpa_trace_dump_funcname(const char *title, void *pc);
 
 #endif /* WPA_TRACE_BFD */
 
+void wpa_trace_deinit(void);
+
 #endif /* TRACE_H */