postgres.git / summary / log / commit / refs
commit b1c0f92eb690388a0739bee2793f5ae8baf5d0bb
Author: Magnus Hagander <magnus@hagander.net>
Date: Thu Jan 14 12:06:03 2016 +0000
First released in: 9.6.0, 9.1.20, 9.2.15, 9.3.11, 9.4.6, 9.5.1
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
src/backend/libpq/auth.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c
index 22a1c1cb274..e70f4729aff 100644
--- a/src/backend/libpq/auth.c
+++ b/src/backend/libpq/auth.c
@@ -1468,6 +1468,8 @@ pg_SSPI_recvauth(Port *port)
(errmsg_internal("could not get user token: error code %d",
(int) GetLastError())));
+ CloseHandle(token);
+
if (!LookupAccountSid(NULL, tokenuser->User.Sid, accountname, &accountnamesize,
domainname, &domainnamesize, &accountnameuse))
ereport(ERROR,
[parent: 5108013dbbfe]