Advice on bug 282320 - Memory leak in ldap_simple_bind_s

"Matthew M. DeLoera" <[email protected]> Thu, 21 Jan 2010 15:38:42 -0500
Newsgroups gmane.comp.mozilla.devel.directory
Message-ID <[email protected]>
Hello all!

In trying to fix some memory leaks in my app, I encountered what appears 
to be bugzilla #282320.

Each time I need to bind, I call ldap_simple_bind() in a temporary 
thread. Once it completely succeeds or fails, that thread ends. If 
successful, I keep the LDAP* around and then start using it from another 
thread. I assume this is what Mark Smith's bug comment meant by "sharing 
LDAP* handles across multiple threads".

The main offender is a 12-byte leak on every bind attempt, in open.c 
line 197 (I'm using SDK 6.0.6).

I really don't want to use a patched SDK, so is there some workaround I 
can try, like overriding the default ld_set_lderrno_fn function? I've 
been looking over the SDK source, but still worried that I don't fully 
understand the ramifications of this.

Thanks!
- Matthew