From: Howard Chu Date: Sat, 20 Mar 2004 09:24:01 +0000 (+0000) Subject: Use REP_MATCHED_MUSTBEFREED reply flag X-Git-Tag: OPENLDAP_REL_ENG_2_2_BP~195 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=aec5d6062056f22a000c69281f98449ad9b1fe66;p=openldap Use REP_MATCHED_MUSTBEFREED reply flag --- diff --git a/servers/slapd/back-bdb/bind.c b/servers/slapd/back-bdb/bind.c index 3a45907c42..280dcf4ecc 100644 --- a/servers/slapd/back-bdb/bind.c +++ b/servers/slapd/back-bdb/bind.c @@ -94,8 +94,10 @@ dn2entry_retry: rs->sr_ref = is_entry_referral( e ) ? get_entry_referrals( op, e ) : NULL; - if (rs->sr_ref) + if (rs->sr_ref) { rs->sr_matched = ch_strdup( e->e_name.bv_val ); + rs->sr_flags |= REP_MATCHED_MUSTBEFREED; + } bdb_cache_return_entry_r( bdb->bi_dbenv, &bdb->bi_cache, e, &lock ); e = NULL; @@ -107,10 +109,8 @@ dn2entry_retry: if ( rs->sr_ref != NULL ) { rs->sr_err = LDAP_REFERRAL; send_ldap_result( op, rs ); - free( (char *)rs->sr_matched ); ber_bvarray_free( rs->sr_ref ); rs->sr_ref = NULL; - rs->sr_matched = NULL; } else { rs->sr_err = LDAP_INVALID_CREDENTIALS; send_ldap_result( op, rs ); @@ -170,6 +170,8 @@ dn2entry_retry: if( rs->sr_ref != NULL ) { rs->sr_err = LDAP_REFERRAL; + rs->sr_matched = ch_strdup( e->e_name.bv_val ); + rs->sr_flags |= REP_MATCHED_MUSTBEFREED; } else { rs->sr_err = LDAP_INVALID_CREDENTIALS; }