leak-detective: Whitelist thread ID getter
authorTobias Brunner <tobias@strongswan.org>
Tue, 13 Sep 2016 15:28:21 +0000 (17:28 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 20 Sep 2016 14:26:05 +0000 (16:26 +0200)
In case an external thread calls into our code and logs messages, a thread
object is allocated that will never be released.  Even if we try to clean
up the object via thread value destructor there is no guarantee that the
thread actually terminates before we check for leaks, which seems to be the
case for the Ada Tasking threads.

src/libstrongswan/utils/leak_detective.c

index e78938c..ad67c03 100644 (file)
@@ -494,7 +494,7 @@ static bool register_hooks()
  * List of functions using static allocation buffers or should be suppressed
  * otherwise on leak report.
  */
-char *whitelist[] = {
+static char *whitelist[] = {
        /* backtraces, including own */
        "backtrace_create",
        "strerror_safe",
@@ -604,6 +604,8 @@ char *whitelist[] = {
        "system__tasking__initialize",
        "system__tasking__initialization__abort_defer",
        "system__tasking__stages__create_task",
+       /* in case external threads call into our code */
+       "thread_current_id",
 };
 
 /**