summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/uinfo.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/uinfo.cc')
-rw-r--r--winsup/cygwin/uinfo.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index b024396e8..a3b734ebf 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -161,6 +161,8 @@ uinfo_init ()
Setting `impersonated' to TRUE seems to be wrong but it
isn't. Impersonated is thought as "Current User and `token'
are coincident". See seteuid() for the mechanism behind that. */
+ if (cygheap->user.token != INVALID_HANDLE_VALUE)
+ CloseHandle (cygheap->user.token);
cygheap->user.token = INVALID_HANDLE_VALUE;
cygheap->user.impersonated = TRUE;