First, I want to apologize for those who have
already read the post I did in the software mailing list. I try this list
because I've almost no feedback and this list is in fact more appropriate to
report my problem.

So, here it is :

I'm using the OpenLDAP C API (2.0.15) to connect to
LDAP servers to perform authentication. I establish a permanent connection
and then sends search requests each time I need to authenticate a user.
Sometimes, especially when the server is stopped, I receive the LDAP_SERVER_DOWN
error as result of my search request. I then have a handle on the broken
connection that I need to free in order to avoid memory leaks. When I wrote my
code, I first used ldap_unbind() but my program exited from time to time in this
function. So I replaced this call by ldap_ld_free() which worked perfectly well
so far.

Now I have to deal with TLS connections and even
with ldap_ld_free, my program exits, and every time. I used a debugger and here
is where the program exits :