Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #7306

Closed (moved)
(moved)
Open
Created Nov 04, 2012 by Trac@tracbot

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

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking