Commit 3e7f0e68 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

net: Don't call CloseServiceHandle() with an invalid handle.

parent fed41f53
......@@ -220,8 +220,11 @@ static BOOL StopService(SC_HANDLE SCManager, SC_HANDLE serviceHandle)
{
output_string(STRING_STOP_DEP, dependencies[counter].lpDisplayName);
dependent_serviceHandle = OpenServiceW(SCManager, dependencies[counter].lpServiceName, SC_MANAGER_ALL_ACCESS);
if(dependent_serviceHandle) result = StopService(SCManager, dependent_serviceHandle);
if(dependent_serviceHandle)
{
result = StopService(SCManager, dependent_serviceHandle);
CloseServiceHandle(dependent_serviceHandle);
}
if(!result) output_string(STRING_CANT_STOP, dependencies[counter].lpDisplayName);
}
}
......
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