X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Frequest.c;h=cb645b18a7dc9a3ab4529ace7461a31e74ac09df;hb=8da110a9e726dbc612b302feafe0109271e6bc59;hp=cabdaca6b3dc6cd4522bbf608c0049476fe7aa7f;hpb=c1117666b1e978b2bb6d3b671ed3ab1fc46a66ff;p=openldap diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index cabdaca6b3..cb645b18a7 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -419,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); } @@ -723,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; @@ -747,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 ); @@ -827,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, @@ -865,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 ); @@ -876,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;