From 56866ecf3d469cacadd36c2d37e397b8daa45fcc Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Wed, 6 Nov 2013 10:10:49 +0100 Subject: [PATCH] leak-detective: Call {gm,local}time_r() to allocate static buffer On OS X Mavericks, these functions use a static allocation and are hard to whitelist using other means. --- src/libstrongswan/utils/leak_detective.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libstrongswan/utils/leak_detective.c b/src/libstrongswan/utils/leak_detective.c index 16e023790..36ed1735c 100644 --- a/src/libstrongswan/utils/leak_detective.c +++ b/src/libstrongswan/utils/leak_detective.c @@ -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); } /**