]> git.sur5r.net Git - openldap/commitdiff
ITS#6746: Preserve error code, plug entry leak
authorHallvard Furuseth <hallvard@openldap.org>
Tue, 14 Dec 2010 13:35:42 +0000 (13:35 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Tue, 14 Dec 2010 13:35:42 +0000 (13:35 +0000)
servers/slapd/overlays/translucent.c

index 03e807c8910cf4e577bf6ac624b4a470bc94aa3a..d6ac0691a0b87bd97cb17ebcceeb6f6f6c814ee4 100644 (file)
@@ -1160,11 +1160,11 @@ static int translucent_search(Operation *op, SlapReply *rs) {
                        av = tavl_end( tc.list, TAVL_DIR_LEFT );
                        while ( av ) {
                                rs->sr_entry = av->avl_data;
-                               rc = test_filter( op, rs->sr_entry, op->ors_filter );
-                               if ( rc == LDAP_COMPARE_TRUE ) {
+                               if ( rc == LDAP_SUCCESS && LDAP_COMPARE_TRUE ==
+                                       test_filter( op, rs->sr_entry, op->ors_filter ))
+                               {
                                        rs->sr_flags = REP_ENTRY_MUSTBEFREED;
                                        rc = send_search_entry( op, rs );
-                                       if ( rc ) break;
                                } else {
                                        entry_free( rs->sr_entry );
                                }