]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
trace: Fix memory use on no-function name path
authorJouni Malinen <j@w1.fi>
Sun, 2 Mar 2014 11:57:11 +0000 (13:57 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 2 Mar 2014 15:15:12 +0000 (17:15 +0200)
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>
src/utils/trace.c

index 6795d417d5d408b298d47d9d4b403b4280c33168..94440f2f9726d502b5f59ed52b0f50f346d75c6c 100644 (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);