diff --git a/security/nss/lib/softoken/pkcs11u.c b/security/nss/lib/softoken/pkcs11u.c index 6be47eb7d8b..7469fea2bb4 100644 --- a/security/nss/lib/softoken/pkcs11u.c +++ b/security/nss/lib/softoken/pkcs11u.c @@ -1841,6 +1841,9 @@ pk11_PutObjectToList(PK11Object *object, PK11ObjectFreeList *list, PRBool optimizeSpace = isSessionObject && ((PK11SessionObject *)object)->optimizeSpace; if (!optimizeSpace && (list->count < MAX_OBJECT_LIST_SIZE)) { + if (list->lock == NULL) { + list->lock = PZ_NewLock(nssILockObject); + } PK11_USE_THREADS(PZ_Lock(list->lock)); object->next = list->head; list->head = object;