summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrelyea%netscape.com <devnull@localhost>2002-01-28 19:18:41 +0000
committerrelyea%netscape.com <devnull@localhost>2002-01-28 19:18:41 +0000
commitc75cb139f64e56f1cdd1e8e97a156c5cace5bc10 (patch)
tree305e5f85514b0c201ab36a28cc534a690940240c
parentb1e073619be727948b5e7a33054b25fe0ae3a5b9 (diff)
downloadnss-hg-c75cb139f64e56f1cdd1e8e97a156c5cace5bc10.tar.gz
Fix crashing problem when trying two switch from fips to non-fips and back.
bug 119214.
-rw-r--r--security/nss/lib/pk11wrap/pk11util.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/security/nss/lib/pk11wrap/pk11util.c b/security/nss/lib/pk11wrap/pk11util.c
index dac513ba8..464cc740d 100644
--- a/security/nss/lib/pk11wrap/pk11util.c
+++ b/security/nss/lib/pk11wrap/pk11util.c
@@ -291,11 +291,11 @@ SECMOD_DeleteInternalModule(char *name) {
SECMODModule *newModule,*oldModule;
if (mlp->module->isFIPS) {
- newModule = SECMOD_CreateModule(NULL,SECMOD_INT_NAME,NULL,
- SECMOD_INT_FLAGS);
+ newModule = SECMOD_CreateModule(NULL, SECMOD_INT_NAME,
+ NULL, SECMOD_INT_FLAGS);
} else {
- newModule = SECMOD_CreateModule(NULL,SECMOD_FIPS_NAME,NULL,
- SECMOD_FIPS_FLAGS);
+ newModule = SECMOD_CreateModule(NULL, SECMOD_FIPS_NAME,
+ NULL, SECMOD_FIPS_FLAGS);
}
if (newModule == NULL) {
SECMODModuleList *last = NULL,*mlp2;
@@ -316,13 +316,14 @@ SECMOD_DeleteInternalModule(char *name) {
return SECFailure;
}
newModule->libraryParams =
- PORT_ArenaStrdup(mlp->module->arena,mlp->module->libraryParams);
+ PORT_ArenaStrdup(newModule->arena,mlp->module->libraryParams);
oldModule = internalModule;
- internalModule = SECMOD_ReferenceModule(newModule);
- SECMOD_AddModule(internalModule);
+ internalModule = NULL;
SECMOD_DestroyModule(oldModule);
SECMOD_DeletePermDB(mlp->module);
SECMOD_DestroyModuleListElement(mlp);
+ internalModule = SECMOD_ReferenceModule(newModule);
+ SECMOD_AddModule(internalModule);
}
return rv;
}