Index: nss/lib/pk11wrap/pk11util.c |
diff --git a/nss/lib/pk11wrap/pk11util.c b/nss/lib/pk11wrap/pk11util.c |
index 4a384ad5bc2a572675627f2e76dc17766577336f..712f267f114bdedd9f2213a81f39766d22d064ae 100644 |
--- a/nss/lib/pk11wrap/pk11util.c |
+++ b/nss/lib/pk11wrap/pk11util.c |
@@ -84,7 +84,7 @@ SECMOD_Shutdown() |
nss_DumpModuleLog(); |
#ifdef DEBUG |
- if (PR_GetEnv("NSS_STRICT_SHUTDOWN")) { |
+ if (PR_GetEnvSecure("NSS_STRICT_SHUTDOWN")) { |
PORT_Assert(secmod_PrivateModuleCount == 0); |
} |
#endif |
@@ -640,6 +640,11 @@ SECMOD_AddNewModuleEx(const char* moduleName, const char* dllPath, |
PR_TRUE: PR_FALSE; |
result = PK11_UpdateSlotAttribute(slot, |
&(PK11_DefaultArray[i]), add); |
+ if (result != SECSuccess) { |
+ SECMOD_ReleaseReadLock(moduleLock); |
+ SECMOD_DestroyModule(module); |
+ return result; |
+ } |
} /* for each mechanism */ |
/* disable each slot if the defaultFlags say so */ |
if (defaultMechanismFlags & PK11_DISABLE_FLAG) { |