veracrypt / VeraCrypt-DCS

VeraCrypt EFI Bootloader for EFI Windows system encryption (LGPL)
GNU Lesser General Public License v3.0
133 stars 58 forks source link

VCCONFIG_ALLOC #20

Closed DavidXanatos closed 4 years ago

DavidXanatos commented 4 years ago

DscVeraCrypt.c

define VCCONFIG_ALLOC(data, size) \

if(data == NULL) MEM_FREE(data); \ data = MEM_ALLOC(size);

Whats the point of calling MEM_FREE on NULL? The code looks to me as if the intention was to do if(data != NULL) MEM_FREE(data); \ i.e. to free the data if there was any...

the way it is when called with a data not null you will end up with a memory leak.

idrassi commented 4 years ago

@DavidXanatos Indeed, this is a bug. I will push a fix for it as you suggested.