8000 Properly close token in sspi authentication · ccneo/postgres@df0bd5a · GitHub
[go: up one dir, main page]

Skip to content

Commit df0bd5a

Browse files
committed
Properly close token in sspi authentication
We can never leak more than one token, but we shouldn't do that. We don't bother closing it in the error paths since the process will exit shortly anyway. Christian Ullrich
1 parent be2b276 commit df0bd5a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/backend/libpq/auth.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,8 @@ pg_SSPI_recvauth(Port *port)
14641464
(errmsg_internal("could not get user token: error code %lu",
14651465
GetLastError())));
14661466

1467+
CloseHandle(token);
1468+
14671469
if (!LookupAccountSid(NULL, tokenuser->User.Sid, accountname, &accountnamesize,
14681470
domainname, &domainnamesize, &accountnameuse))
14691471
ereport(ERROR,

0 commit comments

Comments
 (0)
0