projects
/
reactos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c396222
)
Check error code before it is possibly clobbered. Spotted by w3seek.
author
Gé van Geldorp
<ge@gse.nl>
Mon, 24 Jan 2005 19:32:40 +0000
(19:32 +0000)
committer
Gé van Geldorp
<ge@gse.nl>
Mon, 24 Jan 2005 19:32:40 +0000
(19:32 +0000)
svn path=/trunk/; revision=13251
reactos/apps/utils/shutdown/shutdown.c
patch
|
blob
|
history
diff --git
a/reactos/apps/utils/shutdown/shutdown.c
b/reactos/apps/utils/shutdown/shutdown.c
index
2f99989
..
4bec478
100644
(file)
--- a/
reactos/apps/utils/shutdown/shutdown.c
+++ b/
reactos/apps/utils/shutdown/shutdown.c
@@
-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);