LDAP_MEMFREE
Use the LDAP_MEMFREE API to free the storage
that is allocated by the LDAP library.
- ldap_memfree
- ldap_ber_free
- ldap_control_free
- ldap_controls_free
- ldap_msgfree
Synopsis
#include ldap.h
void ldap_memfree(
char *mem)
void ldap_ber_free(
BerElement *berptr)
void ldap_control_free (
LDAPControl *ctrl)
void ldap_controls_free)
LDAPControl **ctrls)
int ldap_msgfree(
LDAPMessage *msg)Input parameters
- mem
- Specifies the address of storage that is allocated by the LDAP library.
- berptr
- Specifies the address of the
BerElementreturned from ldap_first_attribute() and ldap_next_attribute(). - ctrl
- Specifies the address of an
LDAPControlstructure. - ctrls
- Specifies the address of an
LDAPControllist, represented as a NULL-terminated array of pointers toLDAPControlstructures.
Usage
The ldap_memfree() API
is used to free storage that is allocated by the LDAP library (libldap).
Use this routine as directed when you use ldap_get_option(), ldap_first_attribute(), ldap_default_dn_get(),
and ldap_enetwork_domain_get().
The ldap_ber_free() API
is used to free the BerElement pointed to by berptr.
The LDAP library automatically frees the BerElement when ldap_next_attribute() returns
NULL. The application is responsible for freeing the BerElement if
it does not call ldap_next_attribute() until
it returns NULL.
For those LDAP APIs that allocate an LDAPControl structure,
the ldap_control_free() API can be used.
For
those LDAP APIs that allocate an array of LDAPControl structures,
the ldap_controls_free() API can be used.
The ldap_msgfree() routine is used to free the memory that is allocated for an LDAP message by ldap_result, ldap_search_s, ldap_search_ext_s(), or ldap_search_st(). It takes a pointer to the result to be freed and returns the type of the message it freed.