https://bugs.openldap.org/show_bug.cgi?id=9299
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED
--- Comment #1 from Quanah Gibson-Mount quanah@openldap.org --- Hello,
The error is in the code you provided.
At line 86 you create an ld with ldap_open:
ld = ldap_open("10.71.130.106", 1636);
At line 88, you overwrite that ld with a new one from ldap_initialize:
err = ldap_initialize(&ld, uri.c_str());
This is the source of your leak.
I advise carefully reading the ldap_initialize(3) man page for how to correctly use the function.