summaryrefslogtreecommitdiff
path: root/src/slot.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/slot.c')
-rw-r--r--src/slot.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/slot.c b/src/slot.c
index 9658ea6..ea4bf15 100644
--- a/src/slot.c
+++ b/src/slot.c
@@ -235,6 +235,9 @@ test_slot_info(void)
if(memcmp(only, present, sizeof(CK_SLOT_ID) * n_only) != 0)
P11T_CHECK_FAIL("Present tokens don't match those in token info flags. ie: CKF_TOKEN_PRESENT");
+ free(only);
+ free(present);
+
return CONTINUE;
}
@@ -316,7 +319,6 @@ test_slot_mechanisms(void)
}
}
- /* - */
if(p11t_test_unexpected)
value = mech_count + 5;
else
@@ -389,6 +391,38 @@ p11t_slot_tests(void)
test_slot_mechanisms();
}
+void
+p11t_slot_cleanup(void)
+{
+ CK_ULONG i;
+
+ free(slot_ids);
+ slot_ids = NULL;
+
+ for(i = 0; i < p11t_slot_count; ++i)
+ {
+ free(slot_mech_type[i]);
+ free(slot_mech_info[i]);
+ }
+
+ free(slot_info);
+ slot_info = NULL;
+
+ free(slot_token_info);
+ slot_token_info = NULL;
+
+ free(slot_mech_count);
+ slot_mech_count = NULL;
+
+ free(slot_mech_type);
+ slot_mech_type = NULL;
+
+ free(slot_mech_info);
+ slot_mech_info = NULL;
+
+ p11t_slot_count = 0;
+}
+
/* ----------------------------------------------------------------------------------
* METHODS
*/