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

This commit is contained in:
Huw Davies 2015-07-16 11:56:08 +01:00 committed by Alexandre Julliard
parent 3e7f0e685b
commit 125f3151cb
1 changed files with 4 additions and 4 deletions

View File

@ -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;
}