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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Free correctly LDAPMessage returned by ldap_search_s() in auth.c
Date: 2022-09-10 07:58:27
Message-ID: E1oWvNi-002GP5-MB@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2022-09-10 08:19:44 Re: pgsql: aix: No need to use mkldexport when we want to export all symbol
Previous Message Andrew Dunstan 2022-09-10 06:50:09 Re: pgsql: Fix perltidy breaking perlcritic