mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
Check error code before it is possibly clobbered. Spotted by w3seek.
svn path=/trunk/; revision=13251
This commit is contained in:
parent
c396222f34
commit
c011a8410e
1 changed files with 1 additions and 1 deletions
|
@ -146,7 +146,6 @@ _tmain(int argc, TCHAR *argv[])
|
|||
if (! AdjustTokenPrivileges(hToken, FALSE, &npr, 0, 0, 0)
|
||||
|| ERROR_SUCCESS != GetLastError())
|
||||
{
|
||||
CloseHandle(hToken);
|
||||
if (ERROR_NOT_ALL_ASSIGNED == GetLastError())
|
||||
{
|
||||
_ftprintf(stderr, _T("You are not authorized to shutdown the system\n"));
|
||||
|
@ -155,6 +154,7 @@ _tmain(int argc, TCHAR *argv[])
|
|||
{
|
||||
_ftprintf(stderr, _T("AdjustTokenPrivileges failed with error %d\n"), (int) GetLastError());
|
||||
}
|
||||
CloseHandle(hToken);
|
||||
exit(1);
|
||||
}
|
||||
CloseHandle(hToken);
|
||||
|
|
Loading…
Reference in a new issue