aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan')
-rw-r--r--src/libstrongswan/library.c2
-rw-r--r--src/libstrongswan/library.h5
-rw-r--r--src/libstrongswan/utils/leak_detective.c1
3 files changed, 8 insertions, 0 deletions
diff --git a/src/libstrongswan/library.c b/src/libstrongswan/library.c
index fe7498f1a..6b9043b1a 100644
--- a/src/libstrongswan/library.c
+++ b/src/libstrongswan/library.c
@@ -86,6 +86,8 @@ void library_init(char *settings)
private_library_t *this = malloc_thing(private_library_t);
lib = &this->public;
+ lib->leak_detective = FALSE;
+
#ifdef LEAK_DETECTIVE
this->detective = leak_detective_create();
#endif /* LEAK_DETECTIVE */
diff --git a/src/libstrongswan/library.h b/src/libstrongswan/library.h
index 9d151c4cc..2ea4b624b 100644
--- a/src/libstrongswan/library.h
+++ b/src/libstrongswan/library.h
@@ -108,6 +108,11 @@ struct library_t {
* various settings loaded from settings file
*/
settings_t *settings;
+
+ /**
+ * is leak detective running?
+ */
+ bool leak_detective;
};
/**
diff --git a/src/libstrongswan/utils/leak_detective.c b/src/libstrongswan/utils/leak_detective.c
index 72da4bd37..70726da3b 100644
--- a/src/libstrongswan/utils/leak_detective.c
+++ b/src/libstrongswan/utils/leak_detective.c
@@ -560,6 +560,7 @@ leak_detective_t *leak_detective_create()
if (getenv("LEAK_DETECTIVE_DISABLE") == NULL)
{
+ lib->leak_detective = TRUE;
install_hooks();
}
return &this->public;