summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-12-03 20:53:18 +0100
committerattilamolnar <attilamolnar@hush.com>2012-12-03 21:29:24 +0100
commita87c56faea8962de5951c5409d8f41647b08c875 (patch)
tree563ec42c6c37233b45e4ee868e50adbbd14e8072 /win
parent4451fd13a1accec8d7c2b1bb7fdafd6e50a2566b (diff)
Fix thread handle leak in StartServiceThread()
Diffstat (limited to 'win')
-rw-r--r--win/win32service.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/win/win32service.cpp b/win/win32service.cpp
index b04eff558..0a4b0c5b4 100644
--- a/win/win32service.cpp
+++ b/win/win32service.cpp
@@ -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