From 05f0004cf8a8a6e21383ec65b35f5bbc62906e4c Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Tue, 14 Jul 2020 00:34:11 +0200 Subject: Fix memory leak in some cases caused by wrong check of pointer for calling MEM_FREE (fix Github issue #20) --- Library/VeraCryptLib/DcsVeraCrypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library') 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 -- cgit v1.2.3