winedbg: Close filehandle on one exit branch (Coverity).
This commit is contained in:
parent
aa59e6744d
commit
92286a521f
|
@ -87,7 +87,10 @@ static void* source_map_file(const char* name, HANDLE* hMap, unsigned* size)
|
||||||
hFile = CreateFileA(name, GENERIC_READ, FILE_SHARE_READ, NULL,
|
hFile = CreateFileA(name, GENERIC_READ, FILE_SHARE_READ, NULL,
|
||||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if (hFile == INVALID_HANDLE_VALUE) return (void*)-1;
|
if (hFile == INVALID_HANDLE_VALUE) return (void*)-1;
|
||||||
if (size != NULL && (*size = GetFileSize(hFile, NULL)) == -1) return (void*)-1;
|
if (size != NULL && (*size = GetFileSize(hFile, NULL)) == INVALID_FILE_SIZE) {
|
||||||
|
CloseHandle(hFile);
|
||||||
|
return (void*)-1;
|
||||||
|
}
|
||||||
*hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
|
*hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
|
||||||
CloseHandle(hFile);
|
CloseHandle(hFile);
|
||||||
if (!*hMap) return (void*)-1;
|
if (!*hMap) return (void*)-1;
|
||||||
|
|
Loading…
Reference in New Issue