mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-24 03:19:06 +00:00
Bug 202593: Create slot->freeListLock and slot->sessionLock in the order
consistent with the cleanup code on error return.
This commit is contained in:
parent
2caff01bdb
commit
63123ca797
@ -406,19 +406,20 @@ PK11_NewSlotInfo(SECMODModule *mod)
|
||||
if (slot == NULL) return slot;
|
||||
|
||||
#ifdef PKCS11_USE_THREADS
|
||||
slot->freeListLock = PZ_NewLock(nssILockFreelist);
|
||||
if (slot->freeListLock == NULL) {
|
||||
PZ_DestroyLock(slot->sessionLock);
|
||||
PORT_Free(slot);
|
||||
return slot;
|
||||
}
|
||||
|
||||
slot->sessionLock = mod->isThreadSafe ?
|
||||
PZ_NewLock(nssILockSession) : (PZLock *)mod->refLock;
|
||||
if (slot->sessionLock == NULL) {
|
||||
PORT_Free(slot);
|
||||
return slot;
|
||||
}
|
||||
slot->freeListLock = PZ_NewLock(nssILockFreelist);
|
||||
if (slot->freeListLock == NULL) {
|
||||
if (mod->isThreadSafe) {
|
||||
PZ_DestroyLock(slot->sessionLock);
|
||||
}
|
||||
PORT_Free(slot);
|
||||
return slot;
|
||||
}
|
||||
#else
|
||||
slot->sessionLock = NULL;
|
||||
slot->freeListLock = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user