From: Konstantin C. <Kon...@da...> - 2001-07-12 09:31:59
|
Hi Steffen, Steffen Ries wrote: > Michael Ströder <mi...@st...> 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 > versions. > 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 > hard. > After that, I would add memory leak fixes to my OpenLDAPv2 patches. Regards, Konstantin. -- * * Konstantin Chuguev - Application Engineer * * Francis House, 112 Hills Road * Cambridge CB2 1PQ, United Kingdom D A N T E WWW: http://www.dante.net |