[Date Prev][Date Next]
Memory leak when connect fails? (ITS#864)
Full_Name: Sam Varshavchik
Submission from: (NULL) (184.108.40.206)
I'm seeing a memory leak in a failed connection attempt.
Here's an example.
if (!p) break;
If my server is completely down, I end up losing memory here quickly. If the
server is up, but the password is wrong, I'm not leaking any memory. If the
password is good, and bind succeeds, I'm not leaking memory either. Only when
the server is down, and the connect fails, do I have a large leak here.
When the server is down, ldap_simple_bind_s comes back with LDAP_SERVER_DOWN,
and ldap_unbind_s returns with LDAP_SUCCESS, but something gets leaked.
This will mess up a long-running LDAP client that's designed to be fault
that automatically reconnects to the server when it goes back up.