aboutsummaryrefslogtreecommitdiffstats
path: root/src/openac/openac.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/openac/openac.c')
-rwxr-xr-xsrc/openac/openac.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/openac/openac.c b/src/openac/openac.c
index db9959803..d6e75efc3 100755
--- a/src/openac/openac.c
+++ b/src/openac/openac.c
@@ -220,20 +220,22 @@ int main(int argc, char **argv)
openlog("openac", 0, LOG_AUTHPRIV);
/* initialize library */
+ atexit(library_deinit);
if (!library_init(STRONGSWAN_CONF))
{
- library_deinit();
exit(SS_RC_LIBSTRONGSWAN_INTEGRITY);
}
if (lib->integrity &&
!lib->integrity->check_file(lib->integrity, "openac", argv[0]))
{
fprintf(stderr, "integrity check of openac failed\n");
- library_deinit();
exit(SS_RC_DAEMON_INTEGRITY);
}
- lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR,
- lib->settings->get_str(lib->settings, "openac.load", PLUGINS));
+ if (!lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR,
+ lib->settings->get_str(lib->settings, "openac.load", PLUGINS)))
+ {
+ exit(SS_RC_INITIALIZATION_FAILED);
+ }
/* initialize optionsfrom */
options_t *options = options_create();