Commit 125f3151 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

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

parent 3e7f0e68
......@@ -69,11 +69,11 @@ static HRESULT control_service( const WCHAR *name, DWORD control, VARIANT *retva
goto done;
}
if (!ControlService( service, control, &status )) error = map_error( GetLastError() );
CloseServiceHandle( service );
done:
set_variant( VT_UI4, error, NULL, retval );
CloseServiceHandle( service );
CloseServiceHandle( manager );
if (manager) CloseServiceHandle( manager );
return S_OK;
}
......@@ -183,11 +183,11 @@ static HRESULT start_service( const WCHAR *name, VARIANT *retval )
goto done;
}
if (!StartServiceW( service, 0, NULL )) error = map_error( GetLastError() );
CloseServiceHandle( service );
done:
set_variant( VT_UI4, error, NULL, retval );
CloseServiceHandle( service );
CloseServiceHandle( manager );
if (manager) CloseServiceHandle( manager );
return S_OK;
}
......
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