From a07c97c4aa8527d8d953ea05eb8343d20c8049f8 Mon Sep 17 00:00:00 2001 From: "ian.mcgreer%sun.com" Date: Thu, 11 Apr 2002 19:15:31 +0000 Subject: [PATCH] key should be freed when refcount == 0 after decrement. See bug 126087. --- security/nss/lib/pk11wrap/pk11skey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/nss/lib/pk11wrap/pk11skey.c b/security/nss/lib/pk11wrap/pk11skey.c index 417e91bded70..22bcfc363da5 100644 --- a/security/nss/lib/pk11wrap/pk11skey.c +++ b/security/nss/lib/pk11wrap/pk11skey.c @@ -249,7 +249,7 @@ PK11_FreeSymKey(PK11SymKey *symKey) PK11SlotInfo *slot; PRBool freeit = PR_TRUE; - if (PR_AtomicDecrement(&symKey->refCount) == -1) { + if (PR_AtomicDecrement(&symKey->refCount) == 0) { destroy= PR_TRUE; } if (destroy) {