Bug 557888 - nsCertAlreadyExists always leaks unused arena, r=kaie
authortimeless@mozdev.org
Wed, 07 Apr 2010 13:24:00 -0700
changeset 41732 83c887dff0da702a99ae4b7daf10f5a3bf005900
parent 41731 9fb28d9de2cc7c230f15b213f344243245ca980c
child 41733 1f551cd5803b4ba1a8ee08c3f3254a4ed36b5859
push id13108
push userphilringnalda@gmail.com
push dateMon, 03 May 2010 00:53:54 +0000
treeherdermozilla-central@83c887dff0da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaie
bugs557888
milestone1.9.3a5pre
first release with
nightly linux32
83c887dff0da / 3.7a5pre / 20100503032010 / files
nightly linux64
83c887dff0da / 3.7a5pre / 20100503030804 / files
nightly mac
83c887dff0da / 3.7a5pre / 20100503030614 / files
nightly win32
83c887dff0da / 3.7a5pre / 20100503040502 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 557888 - nsCertAlreadyExists always leaks unused arena, r=kaie
security/manager/ssl/src/nsCrypto.cpp
--- a/security/manager/ssl/src/nsCrypto.cpp
+++ b/security/manager/ssl/src/nsCrypto.cpp
@@ -2209,25 +2209,19 @@ nsCryptoRunnable::Run()
 }
 
 //Quick helper function to check if a newly issued cert
 //already exists in the user's database.
 static PRBool
 nsCertAlreadyExists(SECItem *derCert)
 {
   CERTCertDBHandle *handle = CERT_GetDefaultCertDB();
-  PRArenaPool *arena;
   CERTCertificate *cert;
   PRBool retVal = PR_FALSE;
 
-  arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
-  NS_ASSERTION(arena, "Couldn't allocate an arena!");
-  if (!arena)
-    return PR_FALSE; //What else could we return?
-
   cert = CERT_FindCertByDERCert(handle, derCert);
   if (cert) {
     if (cert->isperm && !cert->nickname && !cert->emailAddr) {
       //If the cert doesn't have a nickname or email addr, it is
       //bogus cruft, so delete it.
       SEC_DeletePermCertificate(cert);
     } else if (cert->isperm) {
       retVal = PR_TRUE;