case LBER_OPT_BER_MEMCTX:
assert( LBER_VALID( ber ) );
- ber->ber_memctx = (void *)invalue;
+ ber->ber_memctx = *(void **)invalue;
return LBER_OPT_SUCCESS;
default:
* regular memory; this only affects subsequent mallocs that
* ber_scanf may invoke.
*/
- ber_set_option( op->o_ber, LBER_OPT_BER_MEMCTX, memctx );
+ ber_set_option( op->o_ber, LBER_OPT_BER_MEMCTX, &memctx );
}
switch ( tag ) {
co_op_free:
- ber_set_option( op->o_ber, LBER_OPT_BER_MEMCTX, NULL );
+ memctx = NULL;
+ ber_set_option( op->o_ber, LBER_OPT_BER_MEMCTX, &memctx );
slap_op_free( op );
no_co_op_free:
assert( LDAP_STAILQ_NEXT(op, o_next) == NULL );
if ( op->o_ber != NULL ) {
- /* Note - the ber and its buffer are in regular memory,
- * so make sure not to use sl_free here.
- */
- ber_set_option( op->o_ber, LBER_OPT_BER_MEMCTX, NULL );
ber_free( op->o_ber, 1 );
}
if ( op->o_dn.bv_val != NULL ) {
#endif
{
ber_init_w_nullc( ber, LBER_USE_DER );
- ber_set_option( ber, LBER_OPT_BER_MEMCTX, op->o_tmpmemctx );
+ ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
}
#ifdef NEW_LOGGING
bv.bv_val = op->o_tmpalloc(bv.bv_len, op->o_tmpmemctx );
ber_init2( ber, &bv, LBER_USE_DER );
- ber_set_option( ber, LBER_OPT_BER_MEMCTX, op->o_tmpmemctx );
+ ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
}
#ifdef LDAP_CONNECTIONLESS
#endif
{
ber_init_w_nullc( ber, LBER_USE_DER );
- ber_set_option( ber, LBER_OPT_BER_MEMCTX, op->o_tmpmemctx );
+ ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
}
rc = ber_printf( ber, "{it{W}" /*"}"*/ , op->o_msgid,
ber_init2( ber, NULL, LBER_USE_DER );
if ( op->o_tmpmemctx ) {
- ber_set_option( ber, LBER_OPT_BER_MEMCTX, op->o_tmpmemctx );
+ ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
}
rc = ldap_pvt_put_filter( ber, str );
/* setup LDAP SYNC control */
sync_ber = ber_alloc_t( LBER_USE_DER );
- ber_set_option( sync_ber, LBER_OPT_BER_MEMCTX, op.o_tmpmemctx );
+ ber_set_option( sync_ber, LBER_OPT_BER_MEMCTX, &op.o_tmpmemctx );
if ( si->syncCookie ) {
ber_printf( sync_ber, "{eO}", abs(si->type), si->syncCookie );
if ( rctrls ) {
rctrlp = *rctrls;
ctrl_ber = ber_alloc_t( LBER_USE_DER );
- ber_set_option( ctrl_ber, LBER_OPT_BER_MEMCTX, op.o_tmpmemctx );
+ ber_set_option( ctrl_ber, LBER_OPT_BER_MEMCTX, &op.o_tmpmemctx );
ber_write( ctrl_ber, rctrlp->ldctl_value.bv_val, rctrlp->ldctl_value.bv_len, 0 );
ber_reset( ctrl_ber, 1 );
if ( rctrls ) {
rctrlp = *rctrls;
ctrl_ber = ber_alloc_t( LBER_USE_DER );
- ber_set_option( ctrl_ber, LBER_OPT_BER_MEMCTX, op->o_tmpmemctx );
+ ber_set_option( ctrl_ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
ber_write( ctrl_ber, rctrlp->ldctl_value.bv_val, rctrlp->ldctl_value.bv_len, 0 );
ber_reset( ctrl_ber, 1 );
ber_scanf( ctrl_ber, "{eo", syncstate, syncUUID );