compiling against OpenLDAP 2.0.11
Konstantin.Chuguev at dante.org.uk
Thu Jul 12 11:31:53 CEST 2001
Steffen Ries wrote:
> Michael Ströder <michael at stroeder.com> writes:
> > Anyone did notice the forwarded warning message by Stig about
> > possible memory leaks with OpenLDAP 2.0.x API?
> > Please glance over it:
> > http://www.geocrawler.com/archives/3/1568/2001/6/0/6036658/
> I looked through it.
> The first issue (ldap_first_attribute) has changed from OpenLDAP 1.2
> to 2.0.x so that the memory is *never* freed by the library. In 1.1 it
> was freed, when the last attribute was read. However, the current
> python-ldap code did never free the memory. IOW, there is a possible
> memory leak in error cases.
> The second issue (ldap_get_dn) has *not* changed between OpenLDAP 1.2
> and 2.0.x, i.e. the same kind of memory leak exists for both API
If we are going to release the latest snapshot without OpenLDAPv2 support
(which I think is a good idea), we would still like to eliminate any memory
leaks :-) In that case, could you please update your patch to do The Right
Thing (TM) for OpenLDAPv1 only? If you don't have enough time, I could do
it myself. I'd just like to get a hint in this case: is it only message.c
that needs to be patched?
> The attached patch should fix both issues. The last "ber_free()"
> should be surrounded by some #ifdef OPENLDAP_2_0_X conditional...
> I scanned through the documentation and did not notice any further
> changes in memory handling, but then again, I did not really look too
After that, I would add memory leak fixes to my OpenLDAPv2 patches.
* * Konstantin Chuguev - Application Engineer
* * Francis House, 112 Hills Road
* Cambridge CB2 1PQ, United Kingdom
D A N T E WWW: http://www.dante.net
More information about the python-ldap