From aec5d6062056f22a000c69281f98449ad9b1fe66 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 20 Mar 2004 09:24:01 +0000 Subject: [PATCH] Use REP_MATCHED_MUSTBEFREED reply flag --- servers/slapd/back-bdb/bind.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; } -- 2.39.5