From: Howard Chu Date: Fri, 14 Dec 2007 20:24:31 +0000 (+0000) Subject: Fix prev commit, must test filter on cleanup X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~312 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b96a96c598b418f501b29b33a554cb70e20642e4;p=openldap Fix prev commit, must test filter on cleanup --- diff --git a/servers/slapd/overlays/translucent.c b/servers/slapd/overlays/translucent.c index edd24bb7b7..b2468aecf4 100644 --- a/servers/slapd/overlays/translucent.c +++ b/servers/slapd/overlays/translucent.c @@ -993,13 +993,19 @@ static int translucent_search(Operation *op, SlapReply *rs) { av = tavl_end( tc.list, TAVL_DIR_LEFT ); while ( av ) { - rs->sr_flags = REP_ENTRY_MUSTBEFREED; rs->sr_entry = av->avl_data; - rc = send_search_entry( op, rs ); - if ( rc ) break; + rc = test_filter( op, rs->sr_entry, op->ors_filter ); + if ( rc == LDAP_COMPARE_TRUE ) { + rs->sr_flags = REP_ENTRY_MUSTBEFREED; + rc = send_search_entry( op, rs ); + if ( rc ) break; + } else { + entry_free( rs->sr_entry ); + } av = tavl_next( av, TAVL_DIR_RIGHT ); } tavl_free( tc.list, NULL ); + rs->sr_entry = NULL; } send_ldap_result( op, rs ); }