mirror of
https://github.com/reactos/reactos.git
synced 2024-06-28 17:01:28 +00:00
- Prevent using of uninitialized values in error case
- Don't leak ServiceHandle and ServiceManagerHandle svn path=/trunk/; revision=39406
This commit is contained in:
parent
57ea9f9e02
commit
f7f3a1294f
|
@ -26,9 +26,9 @@ LPTSTR QueryOpts[] = {
|
|||
LPSERVICE_STATUS_PROCESS
|
||||
QueryService(LPCTSTR ServiceName)
|
||||
{
|
||||
SC_HANDLE hSCManager;
|
||||
SC_HANDLE hSCManager = NULL;
|
||||
LPSERVICE_STATUS_PROCESS pServiceInfo = NULL;
|
||||
SC_HANDLE hSc;
|
||||
SC_HANDLE hSc = NULL;
|
||||
DWORD BufSiz = 0;
|
||||
DWORD BytesNeeded = 0;
|
||||
DWORD Ret;
|
||||
|
@ -71,6 +71,8 @@ QueryService(LPCTSTR ServiceName)
|
|||
goto fail;
|
||||
}
|
||||
|
||||
CloseServiceHandle(hSc);
|
||||
CloseServiceHandle(hSCManager);
|
||||
return pServiceInfo;
|
||||
|
||||
fail:
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
BOOL Start(LPCTSTR ServiceName, LPCTSTR *ServiceArgs, INT ArgCount)
|
||||
{
|
||||
SC_HANDLE hSCManager;
|
||||
SC_HANDLE hSc;
|
||||
SC_HANDLE hSCManager = NULL;
|
||||
SC_HANDLE hSc = NULL;
|
||||
LPSERVICE_STATUS_PROCESS pServiceInfo = NULL;
|
||||
|
||||
#ifdef SCDBG
|
||||
|
|
Loading…
Reference in a new issue