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>
This commit is contained in:
Jouni Malinen 2016-02-16 14:10:29 +02:00 committed by Jouni Malinen
parent 8bcf8de827
commit 6136d43b8e
3 changed files with 10 additions and 0 deletions

View file

@ -372,6 +372,7 @@ void os_program_deinit(void)
if (total) if (total)
wpa_printf(MSG_INFO, "MEMLEAK: total %lu bytes", wpa_printf(MSG_INFO, "MEMLEAK: total %lu bytes",
(unsigned long) total); (unsigned long) total);
wpa_trace_deinit();
#endif /* WPA_TRACE */ #endif /* WPA_TRACE */
} }

View 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 */ #endif /* WPA_TRACE */

View file

@ -66,4 +66,6 @@ void wpa_trace_dump_funcname(const char *title, void *pc);
#endif /* WPA_TRACE_BFD */ #endif /* WPA_TRACE_BFD */
void wpa_trace_deinit(void);
#endif /* TRACE_H */ #endif /* TRACE_H */