[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ldap_msgfree() when ldap_search_s() failed

First, ldap_search_s() is deprecated in favor of ldap_search_ext_s().

But to answer your basic question, if the call allocates an
LDAPMessage, then the caller must free it by calling ldap_msgfree().

Don't recall if this is covered in the LDAPEXT LDAP C API I-D...
see doc/drafts.

At 10:46 PM 5/31/2005, Kazuaki Anami wrote:
>Hello all.
>I'm using openldap 2.2.13 and have a question about ldap_msgfree().
>After executing ldap_search_s() or ldap_result(), it seems to have to
>execute ldap_msgfree() regardless of the success or failure. Is it
>Not executing ldap_msgfree() in the case of failure caused memory
>leak. I couldn't find any information about this. 
>I want to make it sure that executing ldap_msgfree() is safe even if
>ldap_search_s() failed. Is there any information about this?
> Kazuaki Anami (kazuaki@soum.co.jp)