trace: Fix memory use on no-function name path

bfd_demangle() call could be skipped if data.function == NULL. Make sure
the already freed aname pointer cannot be used again in such a case.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-03-02 13:57:11 +02:00
parent d12eb581f9
commit fa0a9f536c

View File

@ -187,6 +187,7 @@ static void wpa_trace_bfd_addr(void *pc)
wpa_printf(MSG_INFO, " %s() %s:%u",
name, filename, data.line);
free(aname);
aname = NULL;
data.found = bfd_find_inliner_info(abfd, &data.filename,
&data.function, &data.line);