summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjulien.pierre.boogz%sun.com <devnull@localhost>2007-12-06 00:40:19 +0000
committerjulien.pierre.boogz%sun.com <devnull@localhost>2007-12-06 00:40:19 +0000
commit47b4e116aeeddff479b16bedaf13d572b9b59222 (patch)
treefcffc89b0a6ad0f52f74c5d3cb7aaff09d76aaaf
parent07478483da1b96e1903aec1b9a76f4e634ad39f2 (diff)
downloadnss-hg-47b4e116aeeddff479b16bedaf13d572b9b59222.tar.gz
Fix for bug 391771 . pk11_config_name and pk11_config_strings leaked on shutdown. Add new PK11_UnconfigurePKCS11 call to free the strings. r=nelson, relyea
-rw-r--r--security/nss/lib/nss/nss.def6
-rw-r--r--security/nss/lib/nss/nssinit.c14
2 files changed, 19 insertions, 1 deletions
diff --git a/security/nss/lib/nss/nss.def b/security/nss/lib/nss/nss.def
index 5f04e14ce..2bf0e6723 100644
--- a/security/nss/lib/nss/nss.def
+++ b/security/nss/lib/nss/nss.def
@@ -901,6 +901,12 @@ DER_TimeToGeneralizedTimeArena;
;+ local:
;+ *;
;+};
+;+NSS_3.11.9 {
+;+ global:
+PK11_UnconfigurePKCS11;
+;+ local:
+;+ *;
+;+};
;+NSS_3.12 { # NSS 3.12 release
;+ global:
CERT_CheckNameSpace;
diff --git a/security/nss/lib/nss/nssinit.c b/security/nss/lib/nss/nssinit.c
index d198366d5..f3aefec99 100644
--- a/security/nss/lib/nss/nssinit.c
+++ b/security/nss/lib/nss/nssinit.c
@@ -127,7 +127,7 @@ nss_makeFlags(PRBool readOnly, PRBool noCertDB,
}
/*
- * statics to remember the PKCS11_ConfigurePKCS11()
+ * statics to remember the PK11_ConfigurePKCS11()
* info.
*/
static char * pk11_config_strings = NULL;
@@ -228,6 +228,18 @@ PK11_ConfigurePKCS11(const char *man, const char *libdes, const char *tokdes,
return;
}
+void PK11_UnconfigurePKCS11(void)
+{
+ if (pk11_config_strings != NULL) {
+ PR_smprintf_free(pk11_config_strings);
+ pk11_config_strings = NULL;
+ }
+ if (pk11_config_name) {
+ PORT_Free(pk11_config_name);
+ pk11_config_name = NULL;
+ }
+}
+
static char *
nss_addEscape(const char *string, char quote)
{