diff options
Diffstat (limited to 'lib/lsan/lsan_interceptors.cpp')
-rw-r--r-- | lib/lsan/lsan_interceptors.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/lsan/lsan_interceptors.cpp b/lib/lsan/lsan_interceptors.cpp index 84a6acda4..601a5efe9 100644 --- a/lib/lsan/lsan_interceptors.cpp +++ b/lib/lsan/lsan_interceptors.cpp @@ -383,6 +383,16 @@ INTERCEPTOR(int, pthread_atfork, void (*prepare)(), void (*parent)(), #define LSAN_MAYBE_INTERCEPT_PTHREAD_ATFORK #endif +#if SANITIZER_INTERCEPT_STRERROR +INTERCEPTOR(char *, strerror, int errnum) { + __lsan::ScopedInterceptorDisabler disabler; + return REAL(strerror)(errnum); +} +#define LSAN_MAYBE_INTERCEPT_STRERROR INTERCEPT_FUNCTION(strerror) +#else +#define LSAN_MAYBE_INTERCEPT_STRERROR +#endif + struct ThreadParam { void *(*callback)(void *arg); void *param; @@ -496,6 +506,8 @@ void InitializeInterceptors() { LSAN_MAYBE_INTERCEPT_ATEXIT; LSAN_MAYBE_INTERCEPT_PTHREAD_ATFORK; + LSAN_MAYBE_INTERCEPT_STRERROR; + #if !SANITIZER_NETBSD && !SANITIZER_FREEBSD if (pthread_key_create(&g_thread_finalize_key, &thread_finalize)) { Report("LeakSanitizer: failed to create thread key.\n"); |