From 96afac4792e990f33f017842918196a9a28fb81c Mon Sep 17 00:00:00 2001 From: "mcgreer%netscape.com" Date: Thu, 13 Sep 2001 22:14:22 +0000 Subject: [PATCH] ah, first bug. init the token last when creating a slot. git-svn-id: svn://10.0.0.236/trunk@102890 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/security/nss/lib/dev/slot.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/mozilla/security/nss/lib/dev/slot.c b/mozilla/security/nss/lib/dev/slot.c index d943fc68e7f..0df3a5b6ea5 100644 --- a/mozilla/security/nss/lib/dev/slot.c +++ b/mozilla/security/nss/lib/dev/slot.c @@ -32,7 +32,7 @@ */ #ifdef DEBUG -static const char CVS_ID[] = "@(#) $RCSfile: slot.c,v $ $Revision: 1.1 $ $Date: 2001-09-13 22:06:10 $ $Name: not supported by cvs2svn $"; +static const char CVS_ID[] = "@(#) $RCSfile: slot.c,v $ $Revision: 1.2 $ $Date: 2001-09-13 22:14:22 $ $Name: not supported by cvs2svn $"; #endif /* DEBUG */ #ifndef DEV_H @@ -112,10 +112,6 @@ NSSSlot_Create goto loser; } } - /* Initialize the token if present. */ - if (slotInfo.flags & CKF_TOKEN_PRESENT) { - token = NSSToken_Create(arena, slotID, rvSlot); - } if (!arenaOpt) { /* Avoid confusion now - only set the slot's arena to a non-NULL value * if a new arena is created. Otherwise, depend on the caller (having @@ -128,10 +124,12 @@ NSSSlot_Create rvSlot->module = parent; rvSlot->name = slotName; rvSlot->ckFlags = slotInfo.flags; - /* Get the token for the slot */ - token = NSSToken_Create(arenaOpt, slotID, rvSlot); - if (!token) { - goto loser; + /* Initialize the token if present. */ + if (slotInfo.flags & CKF_TOKEN_PRESENT) { + token = NSSToken_Create(arena, slotID, rvSlot); + if (!token) { + goto loser; + } } rvSlot->token = token; #ifdef arena_mark_bug_fixed