Index: c2s/authreg_ldap.c =================================================================== RCS file: /home/cvs/jabberd2/c2s/authreg_ldap.c,v retrieving revision 1.13 diff -u -F^f -r1.13 authreg_ldap.c --- c2s/authreg_ldap.c 30 Apr 2004 00:53:31 -0000 1.13 +++ c2s/authreg_ldap.c 2 Dec 2004 15:58:48 -0000 @@ -179,12 +179,19 @@ /** do we have this user? */ static int _ldap_user_exists(authreg_t ar, char *username, char *realm) { + char *dn; + int result; + moddata_t data = (moddata_t) ar->private; if(data->ld == NULL && _ldap_connect(data)) return 0; + + dn = _ldap_search(data, realm, username); + result = (int) dn; + ldap_memfree(dn); - return (int) _ldap_search(data, realm, username); + return result; } /** check the password */ @@ -212,9 +219,11 @@ data->ld = NULL; } + ldap_memfree(dn); return 1; } + ldap_memfree(dn); return 0; }