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
@@ -181,7 +181,7 @@ int ReadVolumeHeader (BOOL bBoot, char *encryptedHeader, Password *password, int
#if !defined(_UEFI)
TC_EVENT keyDerivationCompletedEvent;
TC_EVENT noOutstandingWorkItemEvent;
- KeyDerivationWorkItem *keyDerivationWorkItems;
+ KeyDerivationWorkItem *keyDerivationWorkItems = NULL;
KeyDerivationWorkItem *item;
size_t encryptionThreadCount = GetEncryptionThreadCount();
LONG outstandingWorkItemCount = 0;
@@ -589,8 +589,11 @@ ret:
{
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);