diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-12-28 17:54:08 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-12-28 17:54:08 -0500 |
commit | 8f6a879b16fc664b03c361ae203def52220d0cb9 (patch) | |
tree | cb541a9806018a2fa85c2a1b04727a1e98982aa0 /main.h | |
parent | start some likely/unlikely helpers (diff) | |
download | portage-utils-8f6a879b16fc664b03c361ae203def52220d0cb9.tar.gz portage-utils-8f6a879b16fc664b03c361ae203def52220d0cb9.tar.bz2 portage-utils-8f6a879b16fc664b03c361ae203def52220d0cb9.zip |
add cleanup logic to handle specific leaks
There's a few code paths that we leak resources because we know
we're exiting (soon). Add some logic to avoid false positives.
Diffstat (limited to 'main.h')
-rw-r--r-- | main.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -95,6 +95,19 @@ # define IF_DEBUG(x) #endif +#undef USE_CLEANUP +/* LSAN (Leak Sanitizer) will complain about things we leak. */ +#ifdef __SANITIZE_ADDRESS__ +# define USE_CLEANUP 1 +#endif +/* Coverity catches some things we leak on purpose. */ +#ifdef __COVERITY__ +# define USE_CLEANUP 1 +#endif +#ifndef USE_CLEANUP +# define USE_CLEANUP 0 +#endif + #define GETOPT_LONG(A, a, ex) \ getopt_long(argc, argv, ex A ## _FLAGS, a ## _long_opts, NULL) |