From: Kalle Sommer Nielsen Date: Thu, 11 Aug 2016 02:13:34 +0000 (+0200) Subject: The call to FreeLibrary() should be within the if, so we don't pass INVALID_HANDLE_VA... X-Git-Tag: php-7.2.0alpha1~1548 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff1a3cecae250bdde8955597dc94594161938cdf;p=php The call to FreeLibrary() should be within the if, so we don't pass INVALID_HANDLE_VALUE to it, in case LoadLibrary() fails --- diff --git a/win32/time.c b/win32/time.c index 9063ebf629..dcc0943ec4 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 */