diff options
author | javi%netscape.com <devnull@localhost> | 2001-03-14 18:58:14 +0000 |
---|---|---|
committer | javi%netscape.com <devnull@localhost> | 2001-03-14 18:58:14 +0000 |
commit | 7b9b5a1f3c9ff532b9ccdf1d9dc216d3c8046833 (patch) | |
tree | d035cb0a6409598eb597689ff71521c930e9208f | |
parent | a1bf9a2956464415120131976af5470fa48fb04a (diff) | |
download | nss-hg-7b9b5a1f3c9ff532b9ccdf1d9dc216d3c8046833.tar.gz |
Fix for Bug 71889
Null out secmodname during NSS_Shutdown so that a later call to NSS_Init succesfully initializes the SECMOD libraries.
Also, free the memory allocated to allocated the name of the keydb and remove an unused local variable.
-rw-r--r-- | security/nss/lib/nss/nssinit.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/security/nss/lib/nss/nssinit.c b/security/nss/lib/nss/nssinit.c index d450fdb41..2a51d7463 100644 --- a/security/nss/lib/nss/nssinit.c +++ b/security/nss/lib/nss/nssinit.c @@ -63,6 +63,8 @@ #define KEY_DB_FMT "%skey%s.db" #endif +static char *secmodname = NULL; + static char * nss_certdb_name_cb(void *arg, int dbVersion) { @@ -156,14 +158,13 @@ nss_OpenKeyDB(const char * configdir, const char *prefix, PRBool readOnly) if (keydb == NULL) return SECFailure; SECKEY_SetDefaultKeyDB(keydb); + PORT_Free(name); return SECSuccess; } static SECStatus nss_OpenSecModDB(const char * configdir,const char *dbname) { - static char *secmodname; - /* XXX * For idempotency, this should check to see if the secmodDB is alredy open * but no function exists to make that determination. @@ -172,7 +173,7 @@ nss_OpenSecModDB(const char * configdir,const char *dbname) return SECSuccess; secmodname = PR_smprintf("%s" PATH_SEPARATOR "%s", configdir,dbname); if (secmodname == NULL) - return SECFailure; + return SECFailure; SECMOD_init(secmodname); return SECSuccess; } @@ -338,8 +339,6 @@ NSS_NoDB_Init(const char * configdir) { SECStatus rv = SECSuccess; - SECMODModule *module; - rv = RNG_RNGInit(); if (rv != SECSuccess) { @@ -363,6 +362,7 @@ NSS_Shutdown(void) SECKEYKeyDBHandle *keyHandle; SECMOD_Shutdown(); + PR_FREEIF(secmodname); certHandle = CERT_GetDefaultCertDB(); if (certHandle) CERT_ClosePermCertDB(certHandle); |