mirror of
https://github.com/reactos/wine.git
synced 2024-12-03 17:31:15 +00:00
sc: Fix service handle leak on error path (Coverity).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
53a065ae0a
commit
0a3e54480a
@ -285,15 +285,14 @@ int wmain( int argc, const WCHAR *argv[] )
|
||||
if (service)
|
||||
{
|
||||
SERVICE_FAILURE_ACTIONSW sfa;
|
||||
if (!parse_failure_params( argc - 3, argv + 3, &sfa ))
|
||||
if (parse_failure_params( argc - 3, argv + 3, &sfa ))
|
||||
{
|
||||
WINE_WARN("failed to parse failure parameters\n");
|
||||
CloseServiceHandle( manager );
|
||||
return 1;
|
||||
ret = ChangeServiceConfig2W( service, SERVICE_CONFIG_FAILURE_ACTIONS, &sfa );
|
||||
if (!ret) WINE_TRACE("failed to set service failure actions %u\n", GetLastError());
|
||||
HeapFree( GetProcessHeap(), 0, sfa.lpsaActions );
|
||||
}
|
||||
ret = ChangeServiceConfig2W( service, SERVICE_CONFIG_FAILURE_ACTIONS, &sfa );
|
||||
if (!ret) WINE_TRACE("failed to set service failure actions %u\n", GetLastError());
|
||||
HeapFree( GetProcessHeap(), 0, sfa.lpsaActions );
|
||||
else
|
||||
WINE_WARN("failed to parse failure parameters\n");
|
||||
CloseServiceHandle( service );
|
||||
}
|
||||
else WINE_TRACE("failed to open service %u\n", GetLastError());
|
||||
|
Loading…
Reference in New Issue
Block a user