diff options
author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2007-07-04 23:47:20 +0000 |
---|---|---|
committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2007-07-04 23:47:20 +0000 |
commit | 7b0305f59ddab9ea026b202a8c569912e5bf9a90 (patch) | |
tree | 131d39a22cf97e9e8c6da58ddefabc8138a731c2 /src/libstrongswan/utils/leak_detective.c | |
parent | 08ee5250bd9c43fda5f24d10b791ca2c4c17fcee (diff) | |
download | vyos-strongswan-7b0305f59ddab9ea026b202a8c569912e5bf9a90.tar.gz vyos-strongswan-7b0305f59ddab9ea026b202a8c569912e5bf9a90.zip |
[svn-upgrade] Integrating new upstream version, strongswan (4.1.4)
Diffstat (limited to 'src/libstrongswan/utils/leak_detective.c')
-rw-r--r-- | src/libstrongswan/utils/leak_detective.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/libstrongswan/utils/leak_detective.c b/src/libstrongswan/utils/leak_detective.c index b8a023270..a28ebba51 100644 --- a/src/libstrongswan/utils/leak_detective.c +++ b/src/libstrongswan/utils/leak_detective.c @@ -410,7 +410,10 @@ void *realloc_hook(void *old, size_t bytes, const void *caller) */ void __attribute__ ((constructor)) leak_detective_init() { - install_hooks(); + if (getenv("LEAK_DETECTIVE_DISABLE") == NULL) + { + install_hooks(); + } } /** @@ -418,8 +421,11 @@ void __attribute__ ((constructor)) leak_detective_init() */ void __attribute__ ((destructor)) leak_detective_cleanup() { - uninstall_hooks(); - report_leaks(); + if (getenv("LEAK_DETECTIVE_DISABLE") == NULL) + { + uninstall_hooks(); + report_leaks(); + } } /** @@ -431,6 +437,11 @@ void leak_detective_status(FILE *stream) size_t bytes = 0; memory_header_t *hdr = &first_header; + if (getenv("LEAK_DETECTIVE_DISABLE")) + { + return; + } + pthread_mutex_lock(&mutex); while ((hdr = hdr->next)) { |