dbghelp: Check file handles against INVALID_HANDLE_VALUE, not NULL!

Francois Gouget fgouget at free.fr
Thu Mar 8 08:28:40 CST 2007


---
 dlls/dbghelp/msc.c       |    2 +-
 dlls/dbghelp/pe_module.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c
index febebd4..00ba7c2 100644
--- a/dlls/dbghelp/msc.c
+++ b/dlls/dbghelp/msc.c
@@ -2308,7 +2308,7 @@ BOOL pdb_fetch_file_info(struct pdb_lookup* pdb_lookup)
 
     if (image) UnmapViewOfFile(image);
     if (hMap) CloseHandle(hMap);
-    if (hFile) CloseHandle(hFile);
+    if (hFile != INVALID_HANDLE_VALUE) CloseHandle(hFile);
 
     return ret;
 }
diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c
index be0443a..f8346d1 100644
--- a/dlls/dbghelp/pe_module.c
+++ b/dlls/dbghelp/pe_module.c
@@ -142,7 +142,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module,
 
     if (dbg_mapping) UnmapViewOfFile(dbg_mapping);
     if (hMap) CloseHandle(hMap);
-    if (hFile != NULL) CloseHandle(hFile);
+    if (hFile != INVALID_HANDLE_VALUE) CloseHandle(hFile);
     return ret;
 }
 
-- 
1.4.4.4




More information about the wine-patches mailing list