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

RE: memory leaks (Warning: L-O-N-G response, discussion solicited)

I'll be updating ldap_first/next_attribute soon (in -devel only)
with IETF LDAPEXT C API handling of the ber attribute which is a
bit different from the U-Mich handling.

The implementation (library) must return a pointer to an allocated
BerElement on successful calls to ldap_first_attribute().  (The
implementation allocates the BerElement, not the caller!)  Otherwise,
the implementation should set the BerElement pointer to NULL.

On subsequent ldap_next_attribute() calls only the value of the
pointer is passed in.  It is the responsibility of the caller to
call ber_free( ptr, 0) when ldap_next_attribute returns NULL or
when the caller otherwise done with BerElement.