aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/pkcs11/pkcs11_manager.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2011-04-21 13:21:26 +0200
committerMartin Willi <martin@revosec.ch>2011-04-21 13:35:31 +0200
commit5b0bcfb1fc4aabb6535db91e70f7f262328e664f (patch)
tree000c5588b5da0e498f74e251cd0e1aeaa6d597a9 /src/libstrongswan/plugins/pkcs11/pkcs11_manager.c
parentfdead26ffe1da8501a6ff5e0639a6f44c723e763 (diff)
downloadstrongswan-5b0bcfb1fc4aabb6535db91e70f7f262328e664f.tar.bz2
strongswan-5b0bcfb1fc4aabb6535db91e70f7f262328e664f.tar.xz
Revert alloc_str changes
Diffstat (limited to 'src/libstrongswan/plugins/pkcs11/pkcs11_manager.c')
-rw-r--r--src/libstrongswan/plugins/pkcs11/pkcs11_manager.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libstrongswan/plugins/pkcs11/pkcs11_manager.c b/src/libstrongswan/plugins/pkcs11/pkcs11_manager.c
index 7579e0e2e..431cd6a2c 100644
--- a/src/libstrongswan/plugins/pkcs11/pkcs11_manager.c
+++ b/src/libstrongswan/plugins/pkcs11/pkcs11_manager.c
@@ -74,8 +74,7 @@ static void lib_entry_destroy(lib_entry_t *entry)
{
entry->job->cancel(entry->job);
}
- DESTROY_IF(entry->lib);
- free(entry->path);
+ entry->lib->destroy(entry->lib);
free(entry);
}
@@ -366,12 +365,12 @@ pkcs11_manager_t *pkcs11_manager_create(pkcs11_manager_token_event_t cb,
.this = this,
);
- entry->path = lib->settings->alloc_str(lib->settings,
+ entry->path = lib->settings->get_str(lib->settings,
"libstrongswan.plugins.pkcs11.modules.%s.path", NULL, module);
if (!entry->path)
{
DBG1(DBG_CFG, "PKCS11 module '%s' lacks library path", module);
- lib_entry_destroy(entry);
+ free(entry);
continue;
}
entry->lib = pkcs11_library_create(module, entry->path,
@@ -380,7 +379,7 @@ pkcs11_manager_t *pkcs11_manager_create(pkcs11_manager_token_event_t cb,
FALSE, module));
if (!entry->lib)
{
- lib_entry_destroy(entry);
+ free(entry);
continue;
}
this->libs->insert_last(this->libs, entry);