ber_free

Frees a BerElement structure allocated by the ber_alloc_t or the ber_init function.

Library:*ldapsdk.*
NDS Version:7.xx or higher
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap.h> or <lber.h>
  
  void ber_free (
     BerElement  *ber,
     int          fbuf);
  

Parameters

ber

(IN) Points to a BerElement to be freed.

fbuf

(IN) Flag indicating if the internal buffer associated with the BerElement should also be freed.

1 frees the internal buffer, 0 does not free it.

Remarks

BerElements allocated by the library and returned to the application should be freed.

Note that when ldap_first_attribute returns a BerElement, it should be freed with ber_free(ber, 0). The internal buffer should not be freed since it points to the original searchResults.

If the ber parameter is NULL, the ber_free function does nothing.

See Also

ber_alloc_t, ber_init