Fix: memory leak in urcu-checker urcu/rcu-dereference-checker
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 13 Nov 2014 21:14:36 +0000 (16:14 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 13 Nov 2014 21:14:36 +0000 (16:14 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu-checker.c

index cd4721d3cd95f1a1a4f2454dd5c19b99c5807ff6..1f2f4c16e8ef883046fea4bd2b21e46ba1ea4989 100644 (file)
@@ -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);
        }
 }
This page took 0.0263 seconds and 4 git commands to generate.