From 299fb490a27e7b0e5a60464e33f5ea04d00f0f7c Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 14 Feb 2020 22:32:03 +0000 Subject: [PATCH] ITS#9121 fix prev commit Only flush entry if dynlist_prepare_entry altered it --- servers/slapd/overlays/dynlist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servers/slapd/overlays/dynlist.c b/servers/slapd/overlays/dynlist.c index 613b568b51..104fba3e48 100644 --- a/servers/slapd/overlays/dynlist.c +++ b/servers/slapd/overlays/dynlist.c @@ -962,10 +962,12 @@ dynlist_search2resp( Operation *op, SlapReply *rs ) /* See if this is one of our dynamic entries */ dyn = tavl_find( ds->ds_names, &rs->sr_entry->e_nname, dynlist_avl_cmp ); if ( dyn ) { + Entry *e = rs->sr_entry; dyn->dy_seen = 1; rc = dynlist_prepare_entry( op, rs, dyn->dy_dli ); if ( ds->ds_origfilter && test_filter( op, rs->sr_entry, ds->ds_origfilter ) != LDAP_COMPARE_TRUE ) { - rs_flush_entry( op, rs, NULL ); + if ( e != rs->sr_entry ) + rs_flush_entry( op, rs, NULL ); rc = LDAP_SUCCESS; } return rc;