diff options
author | wtc%netscape.com <devnull@localhost> | 2002-05-09 23:18:15 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 2002-05-09 23:18:15 +0000 |
commit | 355fab932e5a689e81fd61e7f83f114fc5747662 (patch) | |
tree | 549be674c598dffe86e019132233e38e091e52b9 | |
parent | 4b0400061bc79c6a4344e2299c234a8064081adb (diff) | |
download | nss-hg-355fab932e5a689e81fd61e7f83f114fc5747662.tar.gz |
Bugzilla bug 135818: fixed internal slot reference leaks in
PK11_VerifySlotMechanisms and PK11_InitToken. r=relyea.
-rw-r--r-- | security/nss/lib/pk11wrap/pk11slot.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/security/nss/lib/pk11wrap/pk11slot.c b/security/nss/lib/pk11wrap/pk11slot.c index 809c2b3a3..5ac8d00bd 100644 --- a/security/nss/lib/pk11wrap/pk11slot.c +++ b/security/nss/lib/pk11wrap/pk11slot.c @@ -1562,7 +1562,10 @@ PK11_VerifySlotMechanisms(PK11SlotInfo *slot) mechList = (CK_MECHANISM_TYPE *) PORT_Alloc(count *sizeof(CK_MECHANISM_TYPE)); alloced = PR_TRUE; - if (mechList == NULL) return PR_FALSE; + if (mechList == NULL) { + PK11_FreeSlot(intern); + return PR_FALSE; + } } /* get the list */ if (!slot->isThreadSafe) PK11_EnterSlotMonitor(slot); @@ -1822,6 +1825,7 @@ PK11_InitToken(PK11SlotInfo *slot, PRBool loadCerts) random_bytes, sizeof(random_bytes)); PK11_ExitSlotMonitor(slot); } + PK11_FreeSlot(int_slot); } } |