VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Volumes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Volumes.c')
-rw-r--r--src/Common/Volumes.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Common/Volumes.c b/src/Common/Volumes.c
index 53734abb..d3001a94 100644
--- a/src/Common/Volumes.c
+++ b/src/Common/Volumes.c
@@ -180,9 +180,9 @@ int ReadVolumeHeader (BOOL bBoot, char *encryptedHeader, Password *password, int
int pkcs5PrfCount = LAST_PRF_ID - FIRST_PRF_ID + 1;
#if !defined(_UEFI)
TC_EVENT keyDerivationCompletedEvent;
TC_EVENT noOutstandingWorkItemEvent;
- KeyDerivationWorkItem *keyDerivationWorkItems;
+ KeyDerivationWorkItem *keyDerivationWorkItems = NULL;
KeyDerivationWorkItem *item;
size_t encryptionThreadCount = GetEncryptionThreadCount();
LONG outstandingWorkItemCount = 0;
int i;
@@ -588,10 +588,13 @@ ret:
if ((selected_pkcs5_prf == 0) && (encryptionThreadCount > 1))
{
TC_WAIT_EVENT (noOutstandingWorkItemEvent);
- burn (keyDerivationWorkItems, sizeof (KeyDerivationWorkItem) * pkcs5PrfCount);
- TCfree (keyDerivationWorkItems);
+ if (keyDerivationWorkItems)
+ {
+ burn (keyDerivationWorkItems, sizeof (KeyDerivationWorkItem) * pkcs5PrfCount);
+ TCfree (keyDerivationWorkItems);
+ }
#if !defined(DEVICE_DRIVER)
CloseHandle (keyDerivationCompletedEvent);
CloseHandle (noOutstandingWorkItemEvent);