int
ldap_chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp )
{
- int rc, count, len, newdn;
+ int rc, count, len, newdn = 0;
#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_DNS
int ldapref;
#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_DNS */
*hadrefp = 1;
if (( refdn = strchr( tmpref, '/' )) != NULL ) {
*refdn++ = '\0';
- newdn = 1;
- } else {
- newdn = 0;
+ if ( *refdn != '\0' )
+ {
+ newdn = 1;
+ } else
+ {
+ refdn = NULL;
+ }
}
if (( ber = re_encode_request( ld, origreq->lr_ber,