VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-11-10 23:10:08 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-11-10 23:11:12 +0100
commitb2438b5029bfed76e80d3aded8800c5e19c617bf (patch)
tree1ecbca8beae54769437cf5d11eb7008c79d756a3 /src
parent51fa86b246a27f1f863ab98e5dd909affecfb250 (diff)
downloadVeraCrypt-b2438b5029bfed76e80d3aded8800c5e19c617bf.tar.gz
VeraCrypt-b2438b5029bfed76e80d3aded8800c5e19c617bf.zip
Windows: close file handle if the call to GetFileSize fails.
Diffstat (limited to 'src')
-rw-r--r--src/Common/Dlgcode.c3
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);