summaryrefslogtreecommitdiff
path: root/src/libstrongswan/utils/leak_detective.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2007-07-05 00:05:56 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2007-07-05 00:05:56 +0000
commit5db544cc26db378616a46dfa22138f0008cf2930 (patch)
treeff9254d87967bb6f703a5ab5e63edcde2e8a6c17 /src/libstrongswan/utils/leak_detective.c
parent3d44c2edf1a3663c7d4acc4434bc8a3abace1ebf (diff)
downloadvyos-strongswan-5db544cc26db378616a46dfa22138f0008cf2930.tar.gz
vyos-strongswan-5db544cc26db378616a46dfa22138f0008cf2930.zip
- Updated to new upstream release.
Diffstat (limited to 'src/libstrongswan/utils/leak_detective.c')
-rw-r--r--src/libstrongswan/utils/leak_detective.c17
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))
{