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.
According to
https://www.openldap.org/software//man.cgi?query=ldap_search_s&sektion=3&apropos=0&manpath=OpenLDAP+2.4-Release
:

       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: ldap-msg-free.patch
Description: Binary data

Reply via email to