mirror of
https://github.com/reactos/reactos.git
synced 2025-05-17 16:27:00 +00:00
[SC]
- Remove dead code - Fix check for memory deallocation - Don't leak resource CID #500056 CID #500057 CID #501497 CID #716313 svn path=/trunk/; revision=62645
This commit is contained in:
parent
ab56f03e58
commit
35ab776df7
2 changed files with 4 additions and 5 deletions
|
@ -135,15 +135,18 @@ EnumServices(ENUM_SERVICE_STATUS_PROCESS **pServiceStatus,
|
|||
&ResumeHandle,
|
||||
0))
|
||||
{
|
||||
CloseServiceHandle(hSCManager);
|
||||
return NumServices;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ReportLastError();
|
||||
if (pServiceStatus)
|
||||
if (*pServiceStatus)
|
||||
HeapFree(GetProcessHeap(), 0, *pServiceStatus);
|
||||
|
||||
CloseServiceHandle(hSCManager);
|
||||
|
||||
return NumServices;
|
||||
}
|
||||
|
||||
|
@ -237,8 +240,5 @@ Query(LPCTSTR *ServiceArgs,
|
|||
}
|
||||
}
|
||||
|
||||
if (pServiceStatus)
|
||||
HeapFree(GetProcessHeap(), 0, pServiceStatus);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -74,7 +74,6 @@ BOOL Start(LPCTSTR ServiceName, LPCTSTR *ServiceArgs, INT ArgCount)
|
|||
|
||||
fail:
|
||||
ReportLastError();
|
||||
if (pServiceInfo) HeapFree(GetProcessHeap(), 0, pServiceInfo);
|
||||
if (hSc) CloseServiceHandle(hSc);
|
||||
if (hSCManager) CloseServiceHandle(hSCManager);
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in a new issue