Author: gedmurphy
Date: Mon Jul 16 21:17:34 2007
New Revision: 27696
URL:
http://svn.reactos.org/svn/reactos?rev=27696&view=rev
Log:
don't leak handles
Modified:
trunk/reactos/base/system/services/services.c
Modified: trunk/reactos/base/system/services/services.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/servi…
==============================================================================
--- trunk/reactos/base/system/services/services.c (original)
+++ trunk/reactos/base/system/services/services.c Mon Jul 16 21:17:34 2007
@@ -97,6 +97,7 @@
BOOL ScmWaitForEvent()
{
HANDLE hEvent;
+ BOOL ret = FALSE;
hEvent = OpenEvent(EVENT_ALL_ACCESS,
FALSE,
@@ -108,10 +109,12 @@
INFINITE);
if (ret == WAIT_OBJECT_0)
- return TRUE;
- }
-
- return FALSE;
+ ret = TRUE;
+
+ CloseHandle(hEvent);
+ }
+
+ return ret;
}