mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
Check error code before it is possibly clobbered. Spotted by w3seek.
svn path=/trunk/; revision=13251
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user