From 27fc2706ca7fc3fe198eac2652e079982a910f4e Mon Sep 17 00:00:00 2001 From: "wtc%netscape.com" Date: Wed, 8 Jan 2003 21:58:29 +0000 Subject: [PATCH] Bug 186586: If at NSS shutdown there are still certs in the cert caches, cause NSS shutdown and the next NSS initialization to fail but do not destroy the cert caches (and the crypto context and trust domain containing them) to avoid a crash if the NSS client destroys the certs later. New error codes needed to be added to indicate the failure of NSS shutdown and NSS initialization due to this cause. --- security/nss/lib/pki/cryptocontext.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/security/nss/lib/pki/cryptocontext.c b/security/nss/lib/pki/cryptocontext.c index f2c357f30f4..b10c227297d 100644 --- a/security/nss/lib/pki/cryptocontext.c +++ b/security/nss/lib/pki/cryptocontext.c @@ -32,7 +32,7 @@ */ #ifdef DEBUG -static const char CVS_ID[] = "@(#) $RCSfile: cryptocontext.c,v $ $Revision: 1.11 $ $Date: 2002-09-23 21:32:31 $ $Name: $"; +static const char CVS_ID[] = "@(#) $RCSfile: cryptocontext.c,v $ $Revision: 1.12 $ $Date: 2003-01-08 21:58:29 $ $Name: $"; #endif /* DEBUG */ #ifndef DEV_H @@ -89,11 +89,15 @@ NSSCryptoContext_Destroy ( NSSCryptoContext *cc ) { + PRStatus status = PR_SUCCESS; if (cc->certStore) { - nssCertificateStore_Destroy(cc->certStore); + status = nssCertificateStore_Destroy(cc->certStore); + if (status == PR_FAILURE) { + return status; + } } nssArena_Destroy(cc->arena); - return PR_SUCCESS; + return status; } NSS_IMPLEMENT PRStatus