arthur@arthurdejong.org wrote:
Full_Name: Arthur de Jong Version: 2.4.23 OS: Debian URL: Submission from: (NULL) (2001:888:1613:0:218:8bff:fe55:2c9f)
There seems to be a memory leak in the LDAP client library when casing referrals. When the code below is run through valgrind it reports:
==30395== 4,184 (80 direct, 4,104 indirect) bytes in 1 blocks are definitely lost in loss record 3 of 3 ==30395== at 0x402328F: calloc (vg_replace_malloc.c:467) ==30395== by 0x41D2CDF: ber_memcalloc_x (in /usr/lib/liblber-2.4.so.2.5.6) ==30395== by 0x40650A0: ldap_send_server_request (in /usr/lib/libldap_r-2.4.so.2.5.6) ==30395== by 0x4065EB1: ldap_chase_v3referrals (in /usr/lib/libldap_r-2.4.so.2.5.6) ==30395== by 0x40510A3: ldap_result (in /usr/lib/libldap_r-2.4.so.2.5.6) ==30395== by 0x8048871: main (test.c:28)
The code below is not very pretty (does not include error handling) but should free all returned buffers. I can also reproduce the above leak with the ldapsearch command-line tool.
Thanks, reproduced using ldapsearch. Fixed in HEAD.