bifcl: Prevent use of LeakSanitizer on FreeBSD

This commit is contained in:
Jon Siwek 2021-03-12 12:07:12 -08:00 committed by Tim Wojtulewicz
parent 34c4f678cf
commit ae56d45a1f

View file

@ -311,17 +311,19 @@ void finish_alternative_mode()
#endif #endif
#endif #endif
#if defined(USING_ASAN) // FreeBSD doesn't support LeakSanitizer
#if defined(USING_ASAN) && !defined(__FreeBSD__)
#include <sanitizer/lsan_interface.h> #include <sanitizer/lsan_interface.h>
#define BIFCL_LSAN_DISABLE(x) __lsan_disable(x)
#else
#define BIFCL_LSAN_DISABLE(x)
#endif #endif
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
#if defined(USING_ASAN)
// We generally do not care at all if bifcl is leaking and the default // We generally do not care at all if bifcl is leaking and the default
// behavior of LSAN to treat leaks as errors only trips up Zeek's build. // behavior of LSAN to treat leaks as errors only trips up Zeek's build.
__lsan_disable(); BIFCL_LSAN_DISABLE();
#endif
int opt; int opt;