mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 20:07:30 +09:00
[NSS] Simplify error handling in get_token_objects_for_cache.
This commit is contained in:
parent
9d8a3f0848
commit
ecb18ddf57
1 changed files with 5 additions and 2 deletions
|
|
@ -584,8 +584,11 @@ get_token_objects_for_cache(
|
||||||
} else {
|
} else {
|
||||||
PRUint32 j;
|
PRUint32 j;
|
||||||
for (j = 0; j < i; j++) {
|
for (j = 0; j < i; j++) {
|
||||||
/* sigh */
|
/* Objects that were successfully added to the cache do not own a
|
||||||
nssToken_AddRef(cache->objects[objectType][j]->object->token);
|
* token reference (they share a reference with the cache itself).
|
||||||
|
* Nulling out the pointer here prevents the token's refcount
|
||||||
|
* from being decremented in nssCryptokiObject_Destroy */
|
||||||
|
cache->objects[objectType][j]->object->token = NULL;
|
||||||
nssArena_Destroy(cache->objects[objectType][j]->arena);
|
nssArena_Destroy(cache->objects[objectType][j]->arena);
|
||||||
}
|
}
|
||||||
nss_ZFreeIf(cache->objects[objectType]);
|
nss_ZFreeIf(cache->objects[objectType]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue