freeing LDAPMessage in CheckLDAPAuth - Mailing list pgsql-hackers

From Zhihong Yu
Subject freeing LDAPMessage in CheckLDAPAuth
Date
Msg-id CALNJ-vTf5Y+8RtzZ4GjOGE9qWVHZ8awfhnFYc_qGm8fMLUNRAg@mail.gmail.com
Whole thread Raw
Responses Re: freeing LDAPMessage in CheckLDAPAuth
List pgsql-hackers
Hi,
In CheckLDAPAuth(), around line 2606:

        if (r != LDAP_SUCCESS)
        {
            ereport(LOG,
                    (errmsg("could not search LDAP for filter \"%s\" on server \"%s\": %s",

It seems that the call to ldap_msgfree() is missing in the above case.
       Note  that  res  parameter  of  ldap_search_ext_s() and ldap_search_s()       should be freed with ldap_msgfree() regardless of return value of these       functions.
Please see the attached patch which frees the search_message in the above case.

Thanks
Attachment

pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Fix typo function circle_same (src/backend/utils/adt/geo_ops.c)
Next
From: John Naylor
Date:
Subject: Re: warning: comparison of integer expressions of different signedness related to simd.h