summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/mock.c3
-rw-r--r--p11-kit/modules.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/common/mock.c b/common/mock.c
index 1b0aea7..c3f2503 100644
--- a/common/mock.c
+++ b/common/mock.c
@@ -422,9 +422,12 @@ mock_C_Initialize (CK_VOID_PTR init_args)
/* We store CK_ULONG as pointers here, so verify that they fit */
assert (sizeof (CK_ULONG) <= sizeof (void *));
+ free (the_pin);
the_pin = (CK_UTF8CHAR_PTR)strdup ("booo");
n_the_pin = 4;
+ if (the_sessions)
+ p11_dict_free (the_sessions);
the_sessions = p11_dict_new (p11_dict_direct_hash,
p11_dict_direct_equal,
NULL, free_session);
diff --git a/p11-kit/modules.c b/p11-kit/modules.c
index f52c6e1..1ec0f1d 100644
--- a/p11-kit/modules.c
+++ b/p11-kit/modules.c
@@ -1480,6 +1480,8 @@ managed_C_Initialize (CK_X_FUNCTION_LIST *self,
else
rv = initialize_module_inlock_reentrant (managed->mod);
if (rv == CKR_OK) {
+ if (managed->sessions)
+ p11_dict_free (managed->sessions);
managed->sessions = sessions;
managed->initialized = p11_forkid;
} else {