Commit 0a3e5448 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

sc: Fix service handle leak on error path (Coverity).

parent 53a065ae
......@@ -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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment