X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Frequest.c;h=cb645b18a7dc9a3ab4529ace7461a31e74ac09df;hb=8da110a9e726dbc612b302feafe0109271e6bc59;hp=110e8b7000473d6b2102f89c6677e82efca70fc5;hpb=7dc76e7139ac73f9fe067f6222a26ffb30dc6f1a;p=openldap diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index 110e8b7000..cb645b18a7 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -61,10 +61,6 @@ ldap_alloc_ber_with_options( LDAP *ld ) if (( ber = ber_alloc_t( ld->ld_lberoptions )) == NULL ) { ld->ld_errno = LDAP_NO_MEMORY; -#ifdef STR_TRANSLATION - } else { - ldap_set_ber_options( ld, ber ); -#endif /* STR_TRANSLATION */ } return( ber ); @@ -75,13 +71,6 @@ void ldap_set_ber_options( LDAP *ld, BerElement *ber ) { ber->ber_options = ld->ld_lberoptions; -#ifdef STR_TRANSLATION - if (( ld->ld_lberoptions & LBER_TRANSLATE_STRINGS ) != 0 ) { - ber_set_string_translators( ber, - ld->ld_lber_encode_translate_proc, - ld->ld_lber_decode_translate_proc ); - } -#endif /* STR_TRANSLATION */ } @@ -430,7 +419,7 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ) if( lc->lconn_rebind_queue != NULL) { int i; for( i = 0; lc->lconn_rebind_queue[i] != NULL; i++) { - free_strarray(lc->lconn_rebind_queue[i]); + LDAP_VFREE(lc->lconn_rebind_queue[i]); } LDAP_FREE( lc->lconn_rebind_queue); } @@ -734,7 +723,7 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, char **errstrp, if( lc->lconn_rebind_queue != NULL) { /* Release resources of previous list */ - free_strarray(refarray); + LDAP_VFREE(refarray); refarray = NULL; ldap_free_urllist(srv); srv = NULL; @@ -758,7 +747,7 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, char **errstrp, } } /* end for loop */ done: - free_strarray(refarray); + LDAP_VFREE(refarray); ldap_free_urllist(srv); LDAP_FREE( *errstrp ); @@ -838,6 +827,8 @@ ldap_chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp ) ldap_pvt_hex_unescape( ref ); len = strlen( ref ); + /* FIXME: we should use the URL Parser */ + if ( len > LDAP_LDAP_REF_STR_LEN && strncasecmp( ref, LDAP_LDAP_REF_STR, LDAP_LDAP_REF_STR_LEN ) == 0 ) { Debug( LDAP_DEBUG_TRACE, @@ -876,6 +867,13 @@ ldap_chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp ) return( -1 ); } + if (( srv->lud_scheme = LDAP_STRDUP("ldap")) == NULL ) { + LDAP_FREE( (char *)srv ); + ber_free( ber, 1 ); + ld->ld_errno = LDAP_NO_MEMORY; + return( -1 ); + } + if (( srv->lud_host = LDAP_STRDUP( tmpref )) == NULL ) { LDAP_FREE( (char *)srv ); ber_free( ber, 1 ); @@ -887,7 +885,7 @@ ldap_chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp ) *ports++ = '\0'; srv->lud_port = atoi( ports ); } else { - srv->lud_port = ldap_int_global_options.ldo_defport; + srv->lud_port = (LDAP_INT_GLOBAL_OPT())->ldo_defport; } rinfo.ri_msgid = origreq->lr_origid;