summaryrefslogtreecommitdiff
path: root/src/libstrongswan/library.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/library.c')
-rw-r--r--src/libstrongswan/library.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/libstrongswan/library.c b/src/libstrongswan/library.c
index c5bb4cd93..e3ad16411 100644
--- a/src/libstrongswan/library.c
+++ b/src/libstrongswan/library.c
@@ -141,11 +141,13 @@ void library_deinit()
{
lib->leak_detective->report(lib->leak_detective, detailed);
lib->leak_detective->destroy(lib->leak_detective);
+ lib->leak_detective = NULL;
}
+ backtrace_deinit();
arrays_deinit();
+ utils_deinit();
threads_deinit();
- backtrace_deinit();
free((void*)this->public.ns);
free(this);
@@ -249,6 +251,8 @@ bool library_init(char *settings, const char *namespace)
return !this->integrity_failed;
}
+ chunk_hash_seed();
+
INIT(this,
.public = {
.get = _get,
@@ -259,9 +263,10 @@ bool library_init(char *settings, const char *namespace)
);
lib = &this->public;
- backtrace_init();
threads_init();
+ utils_init();
arrays_init();
+ backtrace_init();
#ifdef LEAK_DETECTIVE
lib->leak_detective = leak_detective_create();
@@ -298,6 +303,13 @@ bool library_init(char *settings, const char *namespace)
this->objects = hashtable_create((hashtable_hash_t)hash,
(hashtable_equals_t)equals, 4);
+
+#ifdef STRONGSWAN_CONF
+ if (!settings)
+ {
+ settings = STRONGSWAN_CONF;
+ }
+#endif
this->public.settings = settings_create(settings);
/* all namespace settings may fall back to libstrongswan */
lib->settings->add_fallback(lib->settings, lib->ns, "libstrongswan");