leak-detective: Call {gm,local}time_r() to allocate static buffer
authorMartin Willi <martin@revosec.ch>
Wed, 6 Nov 2013 09:10:49 +0000 (10:10 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 6 Nov 2013 09:30:59 +0000 (10:30 +0100)
On OS X Mavericks, these functions use a static allocation and are hard
to whitelist using other means.

src/libstrongswan/utils/leak_detective.c

index 16e0237..36ed173 100644 (file)
@@ -587,7 +587,12 @@ char *whitelist[] = {
  */
 static void init_static_allocations()
 {
+       struct tm tm;
+       time_t t = 0;
+
        tzset();
+       gmtime_r(&t, &tm);
+       localtime_r(&t, &tm);
 }
 
 /**