Re: Close handle leak in SSPI auth

Lists: pgsql-hackers
From: Christian Ullrich <chris(at)chrullrich(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Close handle leak in SSPI auth
Date: 2016-01-10 19:58:26
Message-ID: n6ud52$733$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello,

here's a one-line patch to close a handle leak in pg_SSPI_recvauth().

According to the docs, the token retrieved with
QuerySecurityContextToken() must be closed.

--
Christian

Attachment Content-Type Size
sspi_close_handle.patch text/plain 547 bytes

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Christian Ullrich <chris(at)chrullrich(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Close handle leak in SSPI auth
Date: 2016-01-14 12:09:25
Message-ID: CABUevEysPW43m7QnA7JjTZk9KEZy0=nD4E_eORTX40xEHs+rsg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, Jan 10, 2016 at 8:58 PM, Christian Ullrich <chris(at)chrullrich(dot)net>
wrote:

> Hello,
>
> here's a one-line patch to close a handle leak in pg_SSPI_recvauth().
>
> According to the docs, the token retrieved with
> QuerySecurityContextToken() must be closed.

We still leak it in a number of the error paths in this case, but I don't
think we need to care about those -- since they are hard errors, the
process exits shortly thereafter anyway.

Applied and backpatched, thanks.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/