summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalle Sommer Nielsen <kalle@php.net>2016-08-11 04:13:34 +0200
committerKalle Sommer Nielsen <kalle@php.net>2016-08-11 04:13:34 +0200
commitff1a3cecae250bdde8955597dc94594161938cdf (patch)
tree98fde5d38c3dcd293fda9895f8c7f11b99c89288
parent36b050c2c517b1b9bc1c67e07722d01f6eed6aa4 (diff)
downloadphp-git-ff1a3cecae250bdde8955597dc94594161938cdf.tar.gz
The call to FreeLibrary() should be within the if, so we don't pass INVALID_HANDLE_VALUE to it, in case LoadLibrary() fails
-rw-r--r--win32/time.c6
1 files changed, 3 insertions, 3 deletions
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 */