VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2020-12-11 23:40:09 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2020-12-11 23:42:14 +0100
commit21674c6aec3a5a914d48c594a538857b8bbe15ef (patch)
tree2a3efaf2ba4049a8c01c58ad86dc33dcf390ec75 /src/Common
parentb48d437c80f8011548383a2e1ae88649a030c1ae (diff)
downloadVeraCrypt-21674c6aec3a5a914d48c594a538857b8bbe15ef.tar.gz
VeraCrypt-21674c6aec3a5a914d48c594a538857b8bbe15ef.zip
Windows: Fix various compiler warnings
Diffstat (limited to 'src/Common')
-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);