summaryrefslogtreecommitdiff
path: root/security/nss/lib
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2002-05-13 17:22:46 +0000
committerwtc%netscape.com <devnull@localhost>2002-05-13 17:22:46 +0000
commitdb0d2cc00d6c51011e8061bd0600de601f0b8574 (patch)
tree5ad6ee9f822975231ce026dc72e8c789b88dcfd5 /security/nss/lib
parentb4307dc7a4dc9c2388eb0cf466da736c44adbe6d (diff)
downloadnss-hg-db0d2cc00d6c51011e8061bd0600de601f0b8574.tar.gz
Bugzilla bug 135069: SEC_PKCS12DestroyExportContext should free the slot
reference allocated in SEC_PKCS12CreateExportContext. r=relyea,mcgreer.
Diffstat (limited to 'security/nss/lib')
-rw-r--r--security/nss/lib/pkcs12/p12e.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/security/nss/lib/pkcs12/p12e.c b/security/nss/lib/pkcs12/p12e.c
index 0e393ed5e..1b86a49ac 100644
--- a/security/nss/lib/pkcs12/p12e.c
+++ b/security/nss/lib/pkcs12/p12e.c
@@ -194,7 +194,7 @@ SEC_PKCS12CreateExportContext(SECKEYGetPasswordKey pwfn, void *pwfnarg,
p12ctxt->integrityEnabled = PR_FALSE;
p12ctxt->arena = arena;
p12ctxt->wincx = wincx;
- p12ctxt->slot = (slot) ? slot : PK11_GetInternalSlot();
+ p12ctxt->slot = (slot) ? PK11_ReferenceSlot(slot) : PK11_GetInternalSlot();
return p12ctxt;
@@ -2147,6 +2147,8 @@ SEC_PKCS12DestroyExportContext(SEC_PKCS12ExportContext *p12ecx)
}
}
+ PK11_FreeSlot(p12ecx->slot);
+
PORT_FreeArena(p12ecx->arena, PR_TRUE);
}