VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2020-07-14 00:34:11 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2020-07-14 00:40:47 +0200
commit05f0004cf8a8a6e21383ec65b35f5bbc62906e4c (patch)
treed0ee787cce95572f71b3b754ba1d8c010aa9be76
parent1921b89c48680ec0a180adeaab26a23c3e5a3f72 (diff)
downloadVeraCrypt-DCS-05f0004cf8a8a6e21383ec65b35f5bbc62906e4c.tar.gz
VeraCrypt-DCS-05f0004cf8a8a6e21383ec65b35f5bbc62906e4c.zip
Fix memory leak in some cases caused by wrong check of pointer for calling MEM_FREE (fix Github issue #20)
-rw-r--r--Library/VeraCryptLib/DcsVeraCrypt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/VeraCryptLib/DcsVeraCrypt.c b/Library/VeraCryptLib/DcsVeraCrypt.c
index b99ed0b..d3eecef 100644
--- a/Library/VeraCryptLib/DcsVeraCrypt.c
+++ b/Library/VeraCryptLib/DcsVeraCrypt.c
@@ -89,7 +89,7 @@ CHAR8* gOnExitCancelled = NULL;
/////////////////////////////////////////////////////////////////////////
#define VCCONFIG_ALLOC(data, size) \
- if(data == NULL) MEM_FREE(data); \
+ if(data != NULL) MEM_FREE(data); \
data = MEM_ALLOC(size);
VOID