From: attilamolnar Date: Mon, 3 Dec 2012 19:53:18 +0000 (+0100) Subject: Fix thread handle leak in StartServiceThread() X-Git-Tag: v2.0.23~416 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=a87c56faea8962de5951c5409d8f41647b08c875;hp=4451fd13a1accec8d7c2b1bb7fdafd6e50a2566b;p=user%2Fhenk%2Fcode%2Finspircd.git Fix thread handle leak in StartServiceThread() --- 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