break;
case LDAP_MOD_DELETE:
- if ( glue_attr_delete )
+ if ( glue_attr_delete ) {
+ err = LDAP_SUCCESS;
break;
+ }
+
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, DETAIL1,
"bdb_modify_internal: delete\n", 0, 0, 0 );
rc = entry_schema_check( op->o_bd, e, save_attrs, text, textbuf, textlen );
if ( rc != LDAP_SUCCESS || op->o_noop ) {
attrs_free( e->e_attrs );
+ /* clear the indexing flags */
+ for ( ap = save_attrs; ap != NULL; ap = ap->a_next ) {
+ ap->a_flags = 0;
+ }
e->e_attrs = save_attrs;
if ( rc != LDAP_SUCCESS ) {
size_t textlen = sizeof textbuf;
DB_TXN *ltid = NULL, *lt2;
struct bdb_op_info opinfo;
- Entry dummy;
+ Entry dummy = {0};
u_int32_t locker = 0;
DB_LOCK lock;
if( 0 ) {
retry: /* transaction retry */
+ if ( dummy.e_attrs ) {
+ attrs_free( dummy.e_attrs );
+ dummy.e_attrs = NULL;
+ }
if( e != NULL ) {
bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
e = NULL;
if ( (rs->sr_err == LDAP_INSUFFICIENT_ACCESS) && opinfo.boi_err ) {
rs->sr_err = opinfo.boi_err;
}
+ /* Only free attrs if they were dup'd. */
+ if ( dummy.e_attrs == e->e_attrs ) dummy.e_attrs = NULL;
switch( rs->sr_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
- attrs_free( dummy.e_attrs );
- dummy.e_attrs = NULL;
goto retry;
}
goto return_results;
switch( rs->sr_err ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
- attrs_free( dummy.e_attrs );
- dummy.e_attrs = NULL;
goto retry;
}
rs->sr_text = "entry update failed";
case BDB_CSN_ABORT :
goto return_results;
case BDB_CSN_RETRY :
- attrs_free( dummy.e_attrs );
- dummy.e_attrs = NULL;
goto retry;
}
}
postread_ctrl = &ctrls[num_ctrls++];
ctrls[num_ctrls] = NULL;
}
- if( slap_read_controls( op, rs, e,
+ if( slap_read_controls( op, rs, &dummy,
&slap_post_read_bv, postread_ctrl ) )
{
#ifdef NEW_LOGGING
switch( rc ) {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
- attrs_free( dummy.e_attrs );
- dummy.e_attrs = NULL;
goto retry;
}
+ dummy.e_attrs = NULL;
if ( LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) {
if ( ctxcsn_added ) {
if( num_ctrls ) rs->sr_ctrls = ctrls;
return_results:
+ if( dummy.e_attrs ) {
+ attrs_free( dummy.e_attrs );
+ }
send_ldap_result( op, rs );
if( rs->sr_err == LDAP_SUCCESS && bdb->bi_txn_cp ) {