}
op->o_bd = be;
- op->o_bd->bd_info = bi;
+ if ( SLAP_ISOVERLAY( op->o_bd ) ) {
+ op->o_bd->bd_info = bi;
+ }
return rc;
}
}
op->o_bd = be;
- op->o_bd->bd_info = bi;
+ if ( SLAP_ISOVERLAY( op->o_bd ) ) {
+ op->o_bd->bd_info = bi;
+ }
return rc;
}
}
op->o_bd = be;
- op->o_bd->bd_info = bi;
+ if ( SLAP_ISOVERLAY( op->o_bd ) ) {
+ op->o_bd->bd_info = bi;
+ }
return rc;
}
}
op->o_bd = be;
- op->o_bd->bd_info = bi;
+ if ( SLAP_ISOVERLAY( op->o_bd ) ) {
+ op->o_bd->bd_info = bi;
+ }
return rc;
}
}
op->o_bd = be;
- op->o_bd->bd_info = bi;
+ if ( SLAP_ISOVERLAY( op->o_bd ) ) {
+ op->o_bd->bd_info = bi;
+ }
return rc;
}
slap_callback *cb = op->o_callback;
if ( rs->sr_type == REP_RESULT && cb != NULL) {
op->o_callback = cb->sc_next;
- ch_free( cb );
+ op->o_tmpfree( cb, op->o_tmpmemctx );
}
}
slap_overinst *on;
BackendDB *be = op->o_bd, db;
slap_callback **sc;
- slap_callback *cb = (slap_callback *) ch_malloc( sizeof( slap_callback ));
+ slap_callback *cb;
int rc = SLAP_CB_CONTINUE;
/* FIXME: used to happen for instance during abandon
db.be_flags |= SLAP_DBFLAG_OVERLAY;
op->o_bd = &db;
}
- cb->sc_cleanup = over_op_func_cleanup;
- cb->sc_response = over_back_response;
- cb->sc_writewait = NULL;
- cb->sc_next = op->o_callback;
- cb->sc_private = oi;
- op->o_callback = cb;
+ if ( op->o_tag != LDAP_REQ_ABANDON && op->o_tag != LDAP_REQ_UNBIND ) {
+ cb = (slap_callback *)op->o_tmpcalloc( 1, sizeof(slap_callback), op->o_tmpmemctx );
+ cb->sc_cleanup = over_op_func_cleanup;
+ cb->sc_response = over_back_response;
+ cb->sc_writewait = NULL;
+ cb->sc_next = op->o_callback;
+ cb->sc_private = oi;
+ op->o_callback = cb;
+ }
rc = overlay_op_walk( op, rs, which, oi, on );
- for ( sc = &op->o_callback; *sc; sc = &(*sc)->sc_next ) {
- if ( *sc == cb ) {
- *sc = cb->sc_next;
- ch_free( cb );
- break;
+ if ( rc != SLAPD_ASYNCOP && op->o_tag != LDAP_REQ_ABANDON && op->o_tag != LDAP_REQ_UNBIND ) {
+ for ( sc = &op->o_callback; *sc; sc = &(*sc)->sc_next ) {
+ if ( *sc == cb ) {
+ *sc = cb->sc_next;
+ op->o_tmpfree( cb, op->o_tmpmemctx );
+ break;
+ }
}
}