At 02:21 AM 6/2/2005, Kazuaki Anami wrote: >> But to answer your basic question, if the call allocates an >> LDAPMessage, then the caller must free it by calling ldap_msgfree(). > >I wonder why ldap_search_s() allocates an LDAPMessage even if it >returns LDAP_NO_SUCH_OBJECT. In order to return the result message of the LDAP operation to the caller.