pgsql: Free correctly LDAPMessage returned by ldap_search_s() in auth.c - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Free correctly LDAPMessage returned by ldap_search_s() in auth.c
Date
Msg-id E1oWvNi-002GP5-MB@gemulon.postgresql.org
Whole thread Raw
List 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(+)


pgsql-committers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: pgsql: Fix perltidy breaking perlcritic
Next
From: Andres Freund
Date:
Subject: Re: pgsql: aix: No need to use mkldexport when we want to export all symbol