ldap_chain_status_t lb_status;
ldap_chain_t *lb_lc;
slap_operation_t lb_op_type;
+ char *lb_text;
int lb_depth;
} ldap_chain_cb_t;
break;
default:
+ /* remember the text before it's freed in ldap_back_op_result */
+ if ( lb.lb_text ) {
+ ber_memfree_x( lb.lb_text, op->o_tmpmemctx );
+ }
+ lb->lb_text = ber_strdup_x( rs->sr_text, op->o_tmpmemctx );
return rs->sr_err;
}
#endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
if ( LDAP_CHAIN_RETURN_ERR( lc ) ) {
sr_err = rs->sr_err = rc;
+ rs->sr_text = lb.lb_text;
rs->sr_type = sr_type;
} else {
op->o_callback = sc;
op->o_ndn = ndn;
+ if ( rs->sr_text == lb.lb_text ) {
+ rs->sr_text = NULL;
+ }
+ if ( lb.lb_text ) {
+ ber_memfree_x( lb.lb_text, op->o_tmpmemctx );
+ }
+
return rc;
}