From ff1a3cecae250bdde8955597dc94594161938cdf Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Thu, 11 Aug 2016 04:13:34 +0200 Subject: [PATCH] The call to FreeLibrary() should be within the if, so we don't pass INVALID_HANDLE_VALUE to it, in case LoadLibrary() fails --- win32/time.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/win32/time.c b/win32/time.c index 9063ebf6290..dcc0943ec40 100644 --- a/win32/time.c +++ b/win32/time.c @@ -38,10 +38,10 @@ static zend_always_inline MyGetSystemTimeAsFileTime get_time_func(void) if (hMod) { /* Max possible resolution <1us, win8/server2012 */ timefunc = (MyGetSystemTimeAsFileTime)GetProcAddress(hMod, "GetSystemTimePreciseAsFileTime"); - } - /* Lower the refcount */ - FreeLibrary(hMod); + /* Lower the refcount */ + FreeLibrary(hMod); + } if(!timefunc) { /* 100ns blocks since 01-Jan-1641 */