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

Re: Memory leak with ldap_first_attribute()/ldap_next_attribute()?



At 07:06 PM 10/4/00 +0200, Bertrand Croq wrote:
>Hi,
>  after some hours of debugging, I have been able to write a simple code
>that produces memory leaks on my system (OpenLDAP 2.0.4 on Linux Debian
>2.2 (x86)):
>
>{
> [... ldap_search() ...]
> for (a=ldap_first_attribute(ld, e, &ber);
>      a!=NULL;
>      a=ldap_next_attribute(ld, e, ber)) {
>  /* nothing in the body */

        ldap_memfree( a );

> }
> if (ber)
>  ber_free(ber,0);
>}
>
>  When I comment out this loop or when ldap_next_attribute() is not
>called (when there is no attribute), I don't get any memory leak... This
>looks like a problem already posted to this mailing list ("Possible
>memory leak in libldap.a/liblber.a" by Ashley Neal Hornbeck on 21 Jan
>1999). Does anybody knows what/where the problem can be?
>
>Thanks.
>-- 
>Bertrand Croq - VIRTUAL NET (http://www.virtual-net.fr)
>80, avenue des Buttes de Coesmes - 35700 RENNES
>tel: +33 2 23 21 06 30 - fax: +33 2 99 38 16 85