Skip to content

Commit ff1a3ce

Browse files
committed
The call to FreeLibrary() should be within the if, so we don't pass INVALID_HANDLE_VALUE to it, in case LoadLibrary() fails
1 parent 36b050c commit ff1a3ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

win32/time.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ static zend_always_inline MyGetSystemTimeAsFileTime get_time_func(void)
3838
if (hMod) {
3939
/* Max possible resolution <1us, win8/server2012 */
4040
timefunc = (MyGetSystemTimeAsFileTime)GetProcAddress(hMod, "GetSystemTimePreciseAsFileTime");
41-
}
4241

43-
/* Lower the refcount */
44-
FreeLibrary(hMod);
42+
/* Lower the refcount */
43+
FreeLibrary(hMod);
44+
}
4545

4646
if(!timefunc) {
4747
/* 100ns blocks since 01-Jan-1641 */

0 commit comments

Comments
 (0)