]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix thread handle leak in StartServiceThread()
authorattilamolnar <attilamolnar@hush.com>
Mon, 3 Dec 2012 19:53:18 +0000 (20:53 +0100)
committerattilamolnar <attilamolnar@hush.com>
Mon, 3 Dec 2012 20:29:24 +0000 (21:29 +0100)
win/win32service.cpp

index b04eff558f7d46184dadcdf49d026f5f7812b7ba..0a4b0c5b4d51a931eac8d6fd461f12ad71e0ffd8 100644 (file)
@@ -113,8 +113,9 @@ void SetServiceRunning()
 /** Starts the worker thread above */
 void StartServiceThread()
 {
-       DWORD dwd;
-       CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)WorkerThread,NULL,0,&dwd);
+       HANDLE hThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)WorkerThread,NULL,0,NULL);
+       if (hThread != NULL)
+               CloseHandle(hThread);
 }
 
 /** This function updates the status of the service in the SCM