diff options
author | Magnus Hagander <magnus@hagander.net> | 2016-01-14 13:06:03 +0100 |
---|---|---|
committer | Magnus Hagander <magnus@hagander.net> | 2016-01-14 13:07:35 +0100 |
commit | ab49f87d5cd4f70fdfe606449ebe1369aa6cbb61 (patch) | |
tree | b737cf79bbb4a59e7297f1b43b7f1f333c7b4827 | |
parent | 7393208b512545034061edce5d124090270f8bac (diff) | |
download | postgresql-ab49f87d5cd4f70fdfe606449ebe1369aa6cbb61.tar.gz |
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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c index 60d8d8848d..334b1a8954 100644 --- a/src/backend/libpq/auth.c +++ b/src/backend/libpq/auth.c @@ -1255,6 +1255,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, |