]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/retcode.c
ITS#6953 do not use the cache db when refreshing
[openldap] / servers / slapd / overlays / retcode.c
index f100ca5022e5cb6bfc72545bb7ee9be9f2191c3e..4dd568324df2025d446f9aec3f86c272d00f55d6 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2005-2008 The OpenLDAP Foundation.
+ * Copyright 2005-2011 The OpenLDAP Foundation.
  * Portions Copyright 2005 Pierangelo Masarati <ando@sys-net.it>
  * All rights reserved.
  *
@@ -165,7 +165,9 @@ retcode_send_onelevel( Operation *op, SlapReply *rs )
                        rs->sr_entry = &rdi->rdi_e;
 
                        rs->sr_err = send_search_entry( op, rs );
+                       rs->sr_flags = 0;
                        rs->sr_entry = NULL;
+                       rs->sr_attrs = NULL;
 
                        switch ( rs->sr_err ) {
                        case LDAP_UNAVAILABLE:  /* connection closed */
@@ -257,6 +259,9 @@ retcode_op_internal( Operation *op, SlapReply *rs )
                1, &op2.ors_filterstr, op2.o_tmpmemctx );
        op2.ors_filter = str2filter_x( &op2, op2.ors_filterstr.bv_val );
 
+       /* errAbsObject is defined by this overlay! */
+       assert( op2.ors_filter != NULL );
+
        db.bd_info = on->on_info->oi_orig;
        op2.o_bd = &db;
 
@@ -273,7 +278,7 @@ retcode_op_internal( Operation *op, SlapReply *rs )
        rc = op2.o_bd->be_search( &op2, rs );
        op->o_abandon = op2.o_abandon;
 
-       filter_free_x( &op2, op2.ors_filter );
+       filter_free_x( &op2, op2.ors_filter, 1 );
        ber_memfree_x( op2.ors_filterstr.bv_val, op2.o_tmpmemctx );
 
        if ( rdc.rdc_flags == SLAP_CB_CONTINUE ) {
@@ -767,6 +772,12 @@ retcode_item_destroy( retcode_item_t *rdi )
 
        entry_clean( &rdi->rdi_e );
 
+       if ( !BER_BVISNULL( &rdi->rdi_unsolicited_oid ) ) {
+               ber_memfree( rdi->rdi_unsolicited_oid.bv_val );
+               if ( !BER_BVISNULL( &rdi->rdi_unsolicited_data ) )
+                       ber_memfree( rdi->rdi_unsolicited_data.bv_val );
+       }
+
        ch_free( rdi );
 }