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

Skip to content

Commit b1c0f92

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 5108013 commit b1c0f92

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
@@ -1468,6 +1468,8 @@ pg_SSPI_recvauth(Port *port)
14681468
(errmsg_internal("could not get user token: error code %d",
14691469
(int) GetLastError())));
14701470

1471+
CloseHandle(token);
1472+
14711473
if (!LookupAccountSid(NULL, tokenuser->User.Sid, accountname, &accountnamesize,
14721474
domainname, &domainnamesize, &accountnameuse))
14731475
ereport(ERROR,

0 commit comments

Comments
 (0)
0