diff --git a/GleeBug/Debugger.Loop.Dll.cpp b/GleeBug/Debugger.Loop.Dll.cpp index 7585cdd..1603180 100644 --- a/GleeBug/Debugger.Loop.Dll.cpp +++ b/GleeBug/Debugger.Loop.Dll.cpp @@ -18,7 +18,8 @@ namespace GleeBug cbLoadDllEvent(loadDll, dll); //close the file handle - CloseHandle(loadDll.hFile); + if(loadDll.hFile) + CloseHandle(loadDll.hFile); } void Debugger::unloadDllEvent(const UNLOAD_DLL_DEBUG_INFO & unloadDll) diff --git a/GleeBug/Debugger.Loop.Process.cpp b/GleeBug/Debugger.Loop.Process.cpp index 5690828..cb37192 100644 --- a/GleeBug/Debugger.Loop.Process.cpp +++ b/GleeBug/Debugger.Loop.Process.cpp @@ -39,7 +39,8 @@ namespace GleeBug cbCreateProcessEvent(createProcess, *mProcess); //close the file handle - CloseHandle(createProcess.hFile); + if(createProcess.hFile) + CloseHandle(createProcess.hFile); } void Debugger::exitProcessEvent(const EXIT_PROCESS_DEBUG_INFO & exitProcess)