]> git.sur5r.net Git - openldap/commitdiff
Fix prev commit, must test filter on cleanup
authorHoward Chu <hyc@openldap.org>
Fri, 14 Dec 2007 20:24:31 +0000 (20:24 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 14 Dec 2007 20:24:31 +0000 (20:24 +0000)
servers/slapd/overlays/translucent.c

index edd24bb7b75c7750aadfe391ff450f08b065e1eb..b2468aecf40faf4d4a94db3080ca6aaf12ceb5f9 100644 (file)
@@ -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 );
        }