Debug( LDAP_DEBUG_TRACE, "ldap_result msgid %d\n", msgid, 0, 0 );
#endif
- if( ld == NULL ) {
- return -1;
- }
-
- if( result == NULL ) {
- ld->ld_errno = LDAP_PARAM_ERROR;
- return -1;
- }
-
lm = chkResponseList(ld, msgid, all);
if ( lm == NULL ) {
{
tmpber = *ber; /* struct copy */
if ( v3ref == 1 ) {
- ; /* V3 search reference or V3 referral sucessfully chased */
+ /* V3 search reference or V3 referral
+ * sucessfully chased. If this message
+ * is a search result, then it has no more
+ * outstanding referrals.
+ */
+ if ( tag == LDAP_RES_SEARCH_RESULT )
+ refer_cnt = 0;
} else if ( ber_scanf( &tmpber, "{iaa}", &lderr,
&lr->lr_res_matched, &lr->lr_res_error )
!= LBER_ERROR ) {