summaryrefslogtreecommitdiffstats
path: root/pfind.c
diff options
context:
space:
mode:
Diffstat (limited to 'pfind.c')
-rw-r--r--pfind.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/pfind.c b/pfind.c
index c82c0bc..fdcb945 100644
--- a/pfind.c
+++ b/pfind.c
@@ -131,6 +131,13 @@ pem_mdFindObjects_Next
plog("Creating object for type %d\n", io->type);
+ if (!io->extRef) {
+ /* increase reference count only once as ckfw will free the found
+ * object only once */
+ io->extRef = CK_TRUE;
+ io->refCount ++;
+ }
+
return pem_CreateMDObject(arena, io, pError);
}
@@ -313,8 +320,11 @@ collect_objects(CK_ATTRIBUTE_PTR pTemplate,
goto done; /* no other object types we understand in this module */
}
- /* find object */
+ /* find objects */
for (i = 0; i < pem_nobjs; i++) {
+ if (NULL == gobj[i])
+ continue;
+
plog(" %d type = %d\n", i, gobj[i]->type);
if ((type == gobj[i]->type)
&& (slotID == gobj[i]->slotID)