pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Free correctly LDAPMessage returned by ldap_search_s() in auth.c
Date: Sat, 10 Sep 2022 07:58:27 +0000
Message-ID: <E1oWvNi-002GP5-MB@gemulon.postgresql.org> (raw)

Free correctly LDAPMessage returned by ldap_search_s() in auth.c

The LDAP wiki states that the search message should be freed regardless
of the return value of ldap_search_s(), but we failed to do so in one
backend code path when searching LDAP with a filter.  This is not
critical in an authentication code path failing in the backend as this
causes such the process to exit promptly, but let's be clean and free
the search message appropriately, as documented by upstream.

All the other code paths failing a LDAP operation do that already, and
somebody looking at this code in the future may miss what LDAP expects
with the search message.

Author: Zhihong Yu
Discussion: https://postgr.es/m/CALNJ-vTf5Y+8RtzZ4GjOGE9qWVHZ8awfhnFYc_qGm8fMLUNRAg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/799437e0bd3259c90d26e195894b6e22eb0b325c

Modified Files
--------------
src/backend/libpq/auth.c | 3 +++
1 file changed, 3 insertions(+)



Message-ID: <E1oWvNi-002GP5-MB@gemulon.postgresql.org>
Permalink:  ../E1oWvNi-002GP5-MB@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oWvNi-002GP5-MB@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Free correctly LDAPMessage returned by ldap_search_s() in auth.c
  In-Reply-To: <E1oWvNi-002GP5-MB@gemulon.postgresql.org>
  References: <E1oWvNi-002GP5-MB@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox