Full_Name: Sam Varshavchik Version: 2.0.7 OS: Linux URL: http://www.openldap.org/lists/openldap-bugs/200010/msg00210.html Submission from: (NULL) (216.179.5.151) I am seeing a memory leak when a connect or bind fails. Initial report was ITS#864 against 1.2. The same test program from ITS#864 also leaks memory under 2.0.7 However, with OpenLDAP 2.0.7 both a failed connection attempt case, or a bad password, leaks memory. In 1.2 only a failed connection leaked memory.
On Sat, Apr 14, 2001 at 04:39:28AM +0000, mrsam@courier-mta.com wrote: > Full_Name: Sam Varshavchik > Version: 2.0.7 > OS: Linux > URL: http://www.openldap.org/lists/openldap-bugs/200010/msg00210.html > Submission from: (NULL) (216.179.5.151) > > > I am seeing a memory leak when a connect or bind fails. Initial report was > ITS#864 against 1.2. The same test program from ITS#864 also leaks memory > under 2.0.7 > > However, with OpenLDAP 2.0.7 both a failed connection attempt case, or a bad > password, leaks memory. In 1.2 only a failed connection leaked memory. I'll look into this. Stig
moved from Incoming to Software Bugs
changed state Open to Feedback
I ran a malloc debugger on a program similar to Sam's; it appears to be leaking in ldap_create(), specifically libraries/libldap/open.c:153 where the SASL stuff is LDAP_STRDUP()'d. I haven't had a good look through the OpenLDAP source, but I think I've got a decent fix for simple binds at http://horde.net/~jwm/openldap-unbind.patch. I'd like to thank Armin Biere at ETHZ for his ccmalloc memory debugger; it was a great help in tracking this down. www.inf.ethz.ch/personal/biere/projects/ccmalloc/ Lastly, I'd like to note that this is by no means the only place that will leak in this manner. There are at least a couple instances of comments stating "this value is leaked" in libraries/libldap/init.c, and might be more in other places where there's SASL code. Someone with a vested interest in the SASL code should give it a good going-over for more leaks like this.
I've updated the aforementioned URL to fix two additional leaks in the SASL code. If you repeatedly bind and unbind (successfully), the SASL portion of OpenLDAP leaks memory. This fixes that.
changed notes changed state Feedback to Test
changed notes changed state Test to Closed
changed notes
moved from Software Bugs to Archive.Software Bugs
applied to HEAD, released in 2.0.19