summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorian.mcgreer%sun.com <devnull@localhost>2002-09-03 19:42:13 +0000
committerian.mcgreer%sun.com <devnull@localhost>2002-09-03 19:42:13 +0000
commit96e8626101e56604fe89dd4dc8b983dd936e132f (patch)
tree9de0b9e9cc75c03b7956cba8dc73c29811094729
parent750f1092ae08fccb73a5fa8d25ad99fe8fc1b0af (diff)
parent6e1180e447f99dd50077c367e29d6ebdd5698d5c (diff)
downloadnss-hg-96e8626101e56604fe89dd4dc8b983dd936e132f.tar.gz
bug 165863, free token on error paths
-rw-r--r--security/nss/lib/pki/trustdomain.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/security/nss/lib/pki/trustdomain.c b/security/nss/lib/pki/trustdomain.c
index 37afb34bb..dc89740d4 100644
--- a/security/nss/lib/pki/trustdomain.c
+++ b/security/nss/lib/pki/trustdomain.c
@@ -1248,11 +1248,15 @@ nssTrustDomain_FindTrustForCertificate
if (!pkio) {
pkio = nssPKIObject_Create(NULL, to, td, NULL);
if (!pkio) {
+ nssToken_Destroy(token);
+ nssCryptokiObject_Destroy(to);
goto loser;
}
} else {
status = nssPKIObject_AddInstance(pkio, to);
if (status != PR_SUCCESS) {
+ nssToken_Destroy(token);
+ nssCryptokiObject_Destroy(to);
goto loser;
}
}
@@ -1270,9 +1274,6 @@ nssTrustDomain_FindTrustForCertificate
return rvt;
loser:
nssSlotArray_Destroy(slots);
- if (to) {
- nssCryptokiObject_Destroy(to);
- }
if (pkio) {
nssPKIObject_Destroy(pkio);
}