diff options
author | wtc%netscape.com <devnull@localhost> | 2002-05-09 23:01:21 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 2002-05-09 23:01:21 +0000 |
commit | 4b0400061bc79c6a4344e2299c234a8064081adb (patch) | |
tree | ef2f62a1173e6928435c3093731da87b3c931963 | |
parent | 1b3572a37dd0a0ba96618c0cd7afc4753e917aba (diff) | |
download | nss-hg-4b0400061bc79c6a4344e2299c234a8064081adb.tar.gz |
Bugzilla bug 135826: fixed the slot reference leaks.
-rw-r--r-- | security/nss/cmd/crmftest/testcrmf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/security/nss/cmd/crmftest/testcrmf.c b/security/nss/cmd/crmftest/testcrmf.c index db9add0bc..42e02a38c 100644 --- a/security/nss/cmd/crmftest/testcrmf.c +++ b/security/nss/cmd/crmftest/testcrmf.c @@ -177,23 +177,28 @@ GetSubjectPubKeyInfo(SECKEYPrivateKey **destPrivKey, SECKEYPrivateKey *privKey = NULL; SECKEYPublicKey *pubKey = NULL; PK11SlotInfo *keySlot = NULL; + PK11SlotInfo *cryptoSlot = NULL; PK11RSAGenParams *rsaParams = NULL; PQGParams *dsaParams = NULL; keySlot = PK11_GetInternalKeySlot(); PK11_Authenticate(keySlot, PR_FALSE, NULL); - PK11_Authenticate(PK11_GetInternalSlot(), PR_FALSE, NULL); + cryptoSlot = PK11_GetInternalSlot(); + PK11_Authenticate(cryptoSlot, PR_FALSE, NULL); + PK11_FreeSlot(cryptoSlot); rsaParams = GetRSAParams(); privKey = PK11_GenerateKeyPair(keySlot, CKM_RSA_PKCS_KEY_PAIR_GEN, (void*)rsaParams, &pubKey, PR_FALSE, PR_FALSE, NULL); /* dsaParams = GetDSAParams(); if (dsaParams == NULL) { + PK11_FreeSlot(keySlot); return NULL; } privKey = PK11_GenerateKeyPair(keySlot, CKM_DSA_KEY_PAIR_GEN, (void*)dsaParams, &pubKey, PR_FALSE, PR_FALSE, NULL);*/ + PK11_FreeSlot(keySlot); if (privKey == NULL || pubKey == NULL) { if (pubKey) { SECKEY_DestroyPublicKey(pubKey); |