Index: res/res_config_ldap.c =================================================================== --- res/res_config_ldap.c (revision 118298) +++ res/res_config_ldap.c (working copy) @@ -27,6 +27,7 @@ * \author Manuel Guesdon * \author Carl-Einar Thorner * \author Russell Bryant + * \author Gavin Henry * * \arg http://www.openldap.org */ @@ -1504,7 +1505,9 @@ bind_result = ldap_sasl_bind_s(ldapConn, user, LDAP_SASL_SIMPLE, &cred, NULL, NULL, NULL); } else { ast_debug(2, "bind %s anonymously\n", url); - bind_result = ldap_sasl_bind_s(ldapConn, NULL, LDAP_SASL_SIMPLE, NULL, NULL, NULL, NULL); + cred.bv_val = NULL; + cred.bv_len = 0; + bind_result = ldap_sasl_bind_s(ldapConn, NULL, LDAP_SASL_SIMPLE, &cred, NULL, NULL, NULL); } if (bind_result == LDAP_SUCCESS) { ast_debug(2, "Successfully connected to database.\n");