VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Volumes.c
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/Volumes.c
parentb48d437c80f8011548383a2e1ae88649a030c1ae (diff)
downloadVeraCrypt-21674c6aec3a5a914d48c594a538857b8bbe15ef.tar.gz
VeraCrypt-21674c6aec3a5a914d48c594a538857b8bbe15ef.zip
Windows: Fix various compiler warnings
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);