test case calls CloseHandle on a LoadLibrary handle
In src/test/test_util.c, one of the Windows-specific test cases, test_util_load_win_lib() uses the wrong release function on a dll handle it obtains during the test. This triggers a kernel32 assertion if a debugger is attached.
I could only find this one place; all others either close the handle properly, or leave it hanging until process shutdown. The fix is simple:
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 04ca42d..4bbcedd 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -2290,7 +2290,7 @@ test_util_load_win_lib(void *ptr)
tt_assert(h);
done:
if (h)
- CloseHandle(h);
+ FreeLibrary(h);
}
#endif
Trac:
Username: ultramage