diff --git a/dlls/dbghelp/path.c b/dlls/dbghelp/path.c index a0e51bd4f36..8c74426eec3 100644 --- a/dlls/dbghelp/path.c +++ b/dlls/dbghelp/path.c @@ -490,7 +490,13 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user) if ((mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL) { IMAGE_NT_HEADERS* nth = RtlImageNtHeader(mapping); - + if (!nth) + { + UnmapViewOfFile(mapping); + CloseHandle(hMap); + CloseHandle(hFile); + return FALSE; + } matched++; timestamp = nth->FileHeader.TimeDateStamp; size = nth->OptionalHeader.SizeOfImage;