diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-11-10 23:10:08 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-11-10 23:11:12 +0100 |
commit | b2438b5029bfed76e80d3aded8800c5e19c617bf (patch) | |
tree | 1ecbca8beae54769437cf5d11eb7008c79d756a3 | |
parent | 51fa86b246a27f1f863ab98e5dd909affecfb250 (diff) | |
download | VeraCrypt-b2438b5029bfed76e80d3aded8800c5e19c617bf.tar.gz VeraCrypt-b2438b5029bfed76e80d3aded8800c5e19c617bf.zip |
Windows: close file handle if the call to GetFileSize fails.
-rw-r--r-- | src/Common/Dlgcode.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index a0c425c5..42e52468 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -7425,7 +7425,10 @@ char *LoadFile (const char *fileName, DWORD *size) return NULL;
if ((fileSize = GetFileSize (h, NULL)) == INVALID_FILE_SIZE)
+ {
+ CloseHandle (h);
return NULL;
+ }
*size = fileSize;
buf = (char *) calloc (*size + 1, 1);
|