Bug 1208405 - [CID 222166] leaked_storage: Variable rv going out of scope leaks the storage it points to, r=ekr
--- a/lib/ckfw/hash.c
+++ b/lib/ckfw/hash.c
@@ -80,19 +80,19 @@ nssCKFWHash_Create
if (!rv) {
*pError = CKR_HOST_MEMORY;
return (nssCKFWHash *)NULL;
}
rv->mutex = nssCKFWInstance_CreateMutex(fwInstance, arena, pError);
if (!rv->mutex) {
if( CKR_OK == *pError ) {
- (void)nss_ZFreeIf(rv);
*pError = CKR_GENERAL_ERROR;
}
+ (void)nss_ZFreeIf(rv);
return (nssCKFWHash *)NULL;
}
rv->plHashTable = PL_NewHashTable(0, nss_ckfw_identity_hash,
PL_CompareValues, PL_CompareValues, &nssArenaHashAllocOps, arena);
if (!rv->plHashTable) {
(void)nssCKFWMutex_Destroy(rv->mutex);
(void)nss_ZFreeIf(rv);