From: Mathieu Desnoyers Date: Thu, 13 Nov 2014 21:14:36 +0000 (-0500) Subject: Fix: memory leak in urcu-checker X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=refs%2Fheads%2Furcu%2Frcu-dereference-checker;p=urcu.git Fix: memory leak in urcu-checker Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu-checker.c b/urcu-checker.c index cd4721d..1f2f4c1 100644 --- a/urcu-checker.c +++ b/urcu-checker.c @@ -163,12 +163,14 @@ void rcu_read_ongoing_check_debug(const char *func) if (r->stackend == 0) { struct backtrace bt; + char *func; + func = get_symbol(__builtin_return_address(0)); err_printf("rcu_dereference() used outside of critical section at %p <%s>\n", - __builtin_return_address(0), - get_symbol(__builtin_return_address(0))); + __builtin_return_address(0), func); save_backtrace(&bt); print_bt(&bt); free_backtrace(&bt); + free(func); } }