Skip to content

Commit

Permalink
Bug 1202413 - objects created by PK11_CreateGenericObject() aren't de…
Browse files Browse the repository at this point in the history
…stroyed by PK11_DestroyGenericObject()

r=martin
  • Loading branch information
rjrelyea committed Oct 25, 2016
1 parent ea9bead commit 568053d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/pk11wrap/pk11merge.c
Expand Up @@ -1246,6 +1246,7 @@ pk11_newMergeLogNode(PLArenaPool *arena,
/* initialize it */
obj->slot = slot;
obj->objectID = id;
obj->owner = PR_FALSE;

newLog->object= obj;
newLog->error = error;
Expand Down
5 changes: 5 additions & 0 deletions lib/pk11wrap/pk11obj.c
Expand Up @@ -1448,6 +1448,7 @@ PK11_FindGenericObjects(PK11SlotInfo *slot, CK_OBJECT_CLASS objClass)
/* initialize it */
obj->slot = PK11_ReferenceSlot(slot);
obj->objectID = objectIDs[i];
obj->owner = PR_FALSE;
obj->next = NULL;
obj->prev = NULL;

Expand Down Expand Up @@ -1528,6 +1529,9 @@ PK11_DestroyGenericObject(PK11GenericObject *object)

PK11_UnlinkGenericObject(object);
if (object->slot) {
if (object->owner) {
PK11_DestroyObject(object->slot, object->objectID);
}
PK11_FreeSlot(object->slot);
}
PORT_Free(object);
Expand Down Expand Up @@ -1595,6 +1599,7 @@ PK11_CreateGenericObject(PK11SlotInfo *slot, const CK_ATTRIBUTE *pTemplate,
/* initialize it */
obj->slot = PK11_ReferenceSlot(slot);
obj->objectID = objectID;
obj->owner = !token;
obj->next = NULL;
obj->prev = NULL;
return obj;
Expand Down
1 change: 1 addition & 0 deletions lib/pk11wrap/secmodti.h
Expand Up @@ -174,6 +174,7 @@ struct PK11GenericObjectStr {
PK11GenericObject *prev;
PK11GenericObject *next;
PK11SlotInfo *slot;
PRBool owner;
CK_OBJECT_HANDLE objectID;
};

Expand Down

0 comments on commit 568053d

Please sign in to comment.