aboutsummaryrefslogtreecommitdiff
path: root/src
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:07:20 +0100
commit3276ca303d44025a5e1232a1e62152ea95a26b03 (patch)
tree9bea4a03fae8ab74c099df03c546ce03cfacd4b2 /src
parentc42df2d46c4223127116b1d7eb27719adbba39ab (diff)
downloadpostgresql-3276ca303d44025a5e1232a1e62152ea95a26b03.tar.gz
postgresql-3276ca303d44025a5e1232a1e62152ea95a26b03.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
Diffstat (limited to 'src')
-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 1e0277f39f0..18cffc912c0 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,