diff options
author | wtc%netscape.com <devnull@localhost> | 2002-05-09 23:34:24 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 2002-05-09 23:34:24 +0000 |
commit | 93f92b7a1054172174a2b17d06458294fe74d94c (patch) | |
tree | 33d409dba3625fe9559d5ed37cf28745a11bd187 | |
parent | a1951570f0ba2554273ccdee7155efa0cb061d6f (diff) | |
download | nss-hg-93f92b7a1054172174a2b17d06458294fe74d94c.tar.gz |
Bugzilla bug 135821: fixed the internal slot reference leak in
PK11_WrapPrivKey. r=relyea.
-rw-r--r-- | security/nss/lib/pk11wrap/pk11skey.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/security/nss/lib/pk11wrap/pk11skey.c b/security/nss/lib/pk11wrap/pk11skey.c index f98a39d87..7955a203e 100644 --- a/security/nss/lib/pk11wrap/pk11skey.c +++ b/security/nss/lib/pk11wrap/pk11skey.c @@ -4758,8 +4758,11 @@ PK11_WrapPrivKey(PK11SlotInfo *slot, PK11SymKey *wrappingKey, privSlot = int_slot; /* The private key has a new home */ newPrivKey = pk11_loadPrivKey(privSlot,privKey,NULL,PR_FALSE,PR_FALSE); + /* newPrivKey has allocated its own reference to the slot, so it's + * safe until we destroy newPrivkey. + */ + PK11_FreeSlot(int_slot); if (newPrivKey == NULL) { - PK11_FreeSlot (int_slot); return SECFailure; } privKey = newPrivKey; |