From 4cfffdd86bbb66408702eab2d9dbc8d1cfe51347 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 24 Jun 2010 11:35:27 -0700 Subject: [PATCH] timeval: Hide "memory leak" from Valgrind. In glibc, "timer_t" is a "void *" that appears to point into malloc()'d memory. By throwing it away entirely, we leak it, which makes valgrind complain. We really don't ever care to use the timer object again, but we can't destroy it without stopping the periodic timer. So make it static to avoid a warning from Valgrind. --- lib/timeval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/timeval.c b/lib/timeval.c index f3e65837f..c69799d08 100644 --- a/lib/timeval.c +++ b/lib/timeval.c @@ -141,7 +141,7 @@ time_enable_restart(void) static void set_up_timer(void) { - timer_t timer_id; + static timer_t timer_id; /* "static" to avoid apparent memory leak. */ struct itimerspec itimer; set_up_monotonic(); -- 2.20.1