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

This commit is contained in:
Huw Davies 2015-07-16 11:56:05 +01:00 committed by Alexandre Julliard
parent a38d2ee10d
commit 3e55f1d2cc
1 changed files with 3 additions and 1 deletions

View File

@ -431,8 +431,10 @@ static inline DWORD get_security_service( LPWSTR full_service_name, DWORD access
err = SERV_OpenSCManagerW( NULL, NULL, access, (SC_HANDLE *)&manager );
if (err == ERROR_SUCCESS)
{
err = SERV_OpenServiceW( manager, full_service_name, access, (SC_HANDLE *)service );
CloseServiceHandle( manager );
}
return err;
}