diff options
author | ian.mcgreer%sun.com <devnull@localhost> | 2002-09-03 19:42:13 +0000 |
---|---|---|
committer | ian.mcgreer%sun.com <devnull@localhost> | 2002-09-03 19:42:13 +0000 |
commit | 96e8626101e56604fe89dd4dc8b983dd936e132f (patch) | |
tree | 9de0b9e9cc75c03b7956cba8dc73c29811094729 /security | |
parent | 750f1092ae08fccb73a5fa8d25ad99fe8fc1b0af (diff) | |
parent | 6e1180e447f99dd50077c367e29d6ebdd5698d5c (diff) | |
download | nss-hg-96e8626101e56604fe89dd4dc8b983dd936e132f.tar.gz |
bug 165863, free token on error paths
Diffstat (limited to 'security')
-rw-r--r-- | security/nss/lib/pki/trustdomain.c | 7 |
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); } |