aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2016-01-14 13:06:03 +0100
committerMagnus Hagander <magnus@hagander.net>2016-01-14 13:06:03 +0100
commit6a61d1ff9dce7406c0affdc013da27ed4252ba29 (patch)
treebebe4e7dc8e4d147a1b5c087d97987c3ab5d8250
parente72d7d85310c397a94748db72d73a59c57e0b0dc (diff)
downloadpostgresql-6a61d1ff9dce7406c0affdc013da27ed4252ba29.tar.gz
postgresql-6a61d1ff9dce7406c0affdc013da27ed4252ba29.zip
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
-rw-r--r--src/backend/libpq/auth.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c
index 0131bfdd91e..57c2f4848b5 100644
--- a/src/backend/libpq/auth.c
+++ b/src/backend/libpq/auth.c
@@ -1253,6 +1253,8 @@ pg_SSPI_recvauth(Port *port)
(errmsg_internal("could not get user token: error code %lu",
GetLastError())));
+ CloseHandle(token);
+
if (!LookupAccountSid(NULL, tokenuser->User.Sid, accountname, &accountnamesize,
domainname, &domainnamesize, &accountnameuse))
ereport(ERROR,