mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-30 23:13:31 +01:00
Windows: close file handle if the call to GetFileSize fails.
This commit is contained in:
parent
51fa86b246
commit
b2438b5029
@ -7425,7 +7425,10 @@ char *LoadFile (const char *fileName, DWORD *size)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if ((fileSize = GetFileSize (h, NULL)) == INVALID_FILE_SIZE)
|
if ((fileSize = GetFileSize (h, NULL)) == INVALID_FILE_SIZE)
|
||||||
|
{
|
||||||
|
CloseHandle (h);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
*size = fileSize;
|
*size = fileSize;
|
||||||
buf = (char *) calloc (*size + 1, 1);
|
buf = (char *) calloc (*size + 1, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user