From 503a10244fa17b2ce50ee22ea8bafdef8b366cdc Mon Sep 17 00:00:00 2001 From: "julien.pierre.boogz%sun.com" Date: Wed, 13 May 2009 22:47:28 +0000 Subject: [PATCH] Fix for bug 492385 . Stop crash freeing named CRL entry on shudown. r=nelson git-svn-id: svn://10.0.0.236/trunk@257183 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/security/nss/lib/certdb/crl.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mozilla/security/nss/lib/certdb/crl.c b/mozilla/security/nss/lib/certdb/crl.c index 2dc0dcdd172..9caa1898191 100644 --- a/mozilla/security/nss/lib/certdb/crl.c +++ b/mozilla/security/nss/lib/certdb/crl.c @@ -37,7 +37,7 @@ /* * Moved from secpkcs7.c * - * $Id: crl.c,v 1.66 2009-04-21 22:53:58 julien.pierre.boogz%sun.com Exp $ + * $Id: crl.c,v 1.67 2009-05-13 22:47:28 julien.pierre.boogz%sun.com Exp $ */ #include "cert.h" @@ -3136,6 +3136,7 @@ static SECStatus addCRLToCache(CERTCertDBHandle* dbhandle, SECItem* crl, rv = SECFailure; /* no need to keep unused CRL around */ SECITEM_ZfreeItem(entry->crl, PR_TRUE); + entry->crl = NULL; } return rv; } @@ -3206,6 +3207,10 @@ SECStatus cert_CacheCRLByGeneralName(CERTCertDBHandle* dbhandle, SECItem* crl, if (!removed) { rv = SECFailure; + /* leak old entry since we couldn't remove it from the hash table */ + } + else + { rv2 = NamedCRLCacheEntry_Destroy(oldEntry); PORT_Assert(SECSuccess == rv2); } @@ -3249,7 +3254,11 @@ SECStatus cert_CacheCRLByGeneralName(CERTCertDBHandle* dbhandle, SECItem* crl, PORT_Assert(removed); if (!removed) { + /* leak old entry since we couldn't remove it from the hash table */ rv = SECFailure; + } + else + { rv2 = NamedCRLCacheEntry_Destroy(oldEntry); PORT_Assert(SECSuccess == rv2); }