diff options
author | Romain Francoise <rfrancoise@debian.org> | 2014-04-15 19:34:32 +0200 |
---|---|---|
committer | Romain Francoise <rfrancoise@debian.org> | 2014-04-15 19:34:32 +0200 |
commit | c5ebfc7b9c16551fe825dc1d79c3f7e2f096f6c9 (patch) | |
tree | d4e2118cbd411caa1a0528eac831030109bc6e65 /src/libstrongswan/utils/leak_detective.c | |
parent | 15fb7904f4431a6e7c305fd08732458f7f885e7e (diff) | |
download | vyos-strongswan-c5ebfc7b9c16551fe825dc1d79c3f7e2f096f6c9.tar.gz vyos-strongswan-c5ebfc7b9c16551fe825dc1d79c3f7e2f096f6c9.zip |
Import upstream version 5.1.3
Diffstat (limited to 'src/libstrongswan/utils/leak_detective.c')
-rw-r--r-- | src/libstrongswan/utils/leak_detective.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/libstrongswan/utils/leak_detective.c b/src/libstrongswan/utils/leak_detective.c index 82eadcb97..af29e2100 100644 --- a/src/libstrongswan/utils/leak_detective.c +++ b/src/libstrongswan/utils/leak_detective.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Tobias Brunner + * Copyright (C) 2013-2014 Tobias Brunner * Copyright (C) 2006-2013 Martin Willi * Hochschule fuer Technik Rapperswil * @@ -973,17 +973,20 @@ leak_detective_t *leak_detective_create() }, ); + if (getenv("LEAK_DETECTIVE_DISABLE") != NULL) + { + free(this); + return NULL; + } + lock = spinlock_create(); thread_disabled = thread_value_create(NULL); init_static_allocations(); - if (getenv("LEAK_DETECTIVE_DISABLE") == NULL) + if (register_hooks()) { - if (register_hooks()) - { - enable_leak_detective(); - } + enable_leak_detective(); } return &this->public; } |