From b2438b5029bfed76e80d3aded8800c5e19c617bf Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 10 Nov 2014 23:10:08 +0100 Subject: Windows: close file handle if the call to GetFileSize fails. --- src/Common/Dlgcode.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- cgit v1.2.3