aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-02-16 12:10:29 (GMT)
committerJouni Malinen <j@w1.fi>2016-02-16 12:10:29 (GMT)
commit6136d43b8edec0193e08250744cd97691ccdbae1 (patch)
treeb9ad0b4e08a116690af5511a4c34b439c016608f /src/utils
parent8bcf8de827e841a35841034edd6f8281a7a3aeba (diff)
downloadhostap-6136d43b8edec0193e08250744cd97691ccdbae1.zip
hostap-6136d43b8edec0193e08250744cd97691ccdbae1.tar.gz
hostap-6136d43b8edec0193e08250744cd97691ccdbae1.tar.bz2
trace: Free symbols on program exit
This makes valgrind memleak checks with CONFIG_WPA_TRACE=y somewhat cleaner. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/os_unix.c1
-rw-r--r--src/utils/trace.c7
-rw-r--r--src/utils/trace.h2
3 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/os_unix.c b/src/utils/os_unix.c
index 8f8dc5b..0118d98 100644
--- a/src/utils/os_unix.c
+++ b/src/utils/os_unix.c
@@ -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 */
}
diff --git a/src/utils/trace.c b/src/utils/trace.c
index 8484d27..d98c4b0 100644
--- a/src/utils/trace.c
+++ b/src/utils/trace.c
@@ -366,4 +366,11 @@ void wpa_trace_check_ref(const void *addr)
}
}
+
+void wpa_trace_deinit(void)
+{
+ free(syms);
+ syms = NULL;
+}
+
#endif /* WPA_TRACE */
diff --git a/src/utils/trace.h b/src/utils/trace.h
index 43ed86c..d1636de 100644
--- a/src/utils/trace.h
+++ b/src/utils/trace.h
@@ -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 */