Commit 1372965d authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

ITS#3092: Rename sl_free() and friends to slap_sl_free()

parent 0aeec234
......@@ -1777,7 +1777,7 @@ aci_set_gather (SetCookie *cookie, struct berval *name, struct berval *attr)
backend_attribute(cp->op,
cp->e, &ndn, desc, &bvals);
}
sl_free(ndn.bv_val, cp->op->o_tmpmemctx);
slap_sl_free(ndn.bv_val, cp->op->o_tmpmemctx);
}
return(bvals);
}
......@@ -1845,7 +1845,7 @@ aci_match_set (
cookie.e = e;
rc = (slap_set_filter(aci_set_gather, (SetCookie *)&cookie, &set,
&op->o_ndn, &e->e_nname, NULL) > 0);
sl_free(set.bv_val, op->o_tmpmemctx);
slap_sl_free(set.bv_val, op->o_tmpmemctx);
}
return(rc);
}
......
......@@ -188,7 +188,7 @@ attr_merge_normalize(
for ( i = 0; vals[i].bv_val; i++ );
nvals = sl_calloc( sizeof(struct berval), i + 1, memctx );
nvals = slap_sl_calloc( sizeof(struct berval), i + 1, memctx );
for ( i = 0; vals[i].bv_val; i++ ) {
rc = (*desc->ad_type->sat_equality->smr_normalize)(
SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX,
......@@ -275,7 +275,7 @@ attr_merge_normalize_one(
rc = attr_merge_one( e, desc, val, nvalp );
if ( nvalp != NULL ) {
sl_free( nval.bv_val, memctx );
slap_sl_free( nval.bv_val, memctx );
}
return rc;
}
......
......@@ -330,7 +330,7 @@ bdb_abandon( Operation *op, SlapReply *rs )
ps = bdb_drop_psearch( op, op->oq_abandon.rs_msgid );
if ( ps ) {
if ( ps->o_tmpmemctx ) {
sl_mem_destroy( NULL, ps->o_tmpmemctx );
slap_sl_mem_destroy( NULL, ps->o_tmpmemctx );
}
slap_op_free ( ps );
return LDAP_SUCCESS;
......@@ -348,7 +348,7 @@ bdb_cancel( Operation *op, SlapReply *rs )
rs->sr_err = LDAP_CANCELLED;
send_ldap_result( ps, rs );
if ( ps->o_tmpmemctx ) {
sl_mem_destroy( NULL, ps->o_tmpmemctx );
slap_sl_mem_destroy( NULL, ps->o_tmpmemctx );
}
slap_op_free ( ps );
return LDAP_SUCCESS;
......@@ -1192,9 +1192,9 @@ id2entry_retry:
rs->sr_flags = 0;
result = send_search_entry( sop, rs );
if ( cookie.bv_val ) ch_free( cookie.bv_val );
sl_free( ctrls[num_ctrls-1]->ldctl_value.bv_val,
slap_sl_free( ctrls[num_ctrls-1]->ldctl_value.bv_val,
sop->o_tmpmemctx );
sl_free( ctrls[--num_ctrls], sop->o_tmpmemctx );
slap_sl_free( ctrls[--num_ctrls], sop->o_tmpmemctx );
ctrls[num_ctrls] = NULL;
rs->sr_ctrls = NULL;
}
......@@ -1228,9 +1228,9 @@ id2entry_retry:
rs->sr_attrs = sop->oq_search.rs_attrs;
rs->sr_flags = 0;
result = send_search_entry( sop, rs );
sl_free( ctrls[num_ctrls-1]->ldctl_value.bv_val,
slap_sl_free( ctrls[num_ctrls-1]->ldctl_value.bv_val,
sop->o_tmpmemctx );
sl_free( ctrls[--num_ctrls], sop->o_tmpmemctx );
slap_sl_free( ctrls[--num_ctrls], sop->o_tmpmemctx );
ctrls[num_ctrls] = NULL;
rs->sr_ctrls = NULL;
} else { /* PRESENT */
......@@ -1414,10 +1414,10 @@ nochange:
rs->sr_rspoid = NULL;
send_ldap_result( sop, rs );
if ( ctrls[num_ctrls-1]->ldctl_value.bv_val != NULL ) {
sl_free( ctrls[num_ctrls-1]->ldctl_value.bv_val,
slap_sl_free( ctrls[num_ctrls-1]->ldctl_value.bv_val,
sop->o_tmpmemctx );
}
sl_free( ctrls[--num_ctrls], sop->o_tmpmemctx );
slap_sl_free( ctrls[--num_ctrls], sop->o_tmpmemctx );
ctrls[num_ctrls] = NULL;
if ( cookie.bv_val ) ch_free( cookie.bv_val );
}
......
......@@ -715,11 +715,11 @@ cleanup:
op->o_conn->c_sasl_bindop = NULL;
if( op->o_req_dn.bv_val != NULL ) {
sl_free( op->o_req_dn.bv_val, op->o_tmpmemctx );
slap_sl_free( op->o_req_dn.bv_val, op->o_tmpmemctx );
op->o_req_dn.bv_val = NULL;
}
if( op->o_req_ndn.bv_val != NULL ) {
sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
slap_sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
op->o_req_ndn.bv_val = NULL;
}
......
......@@ -82,9 +82,9 @@ ch_realloc(
ch_free( block );
}
ctx = sl_context( block );
ctx = slap_sl_context( block );
if ( ctx ) {
return sl_realloc( block, size, ctx );
return slap_sl_realloc( block, size, ctx );
}
if ( (new = (void *) ber_memrealloc_x( block, size, NULL )) == NULL ) {
......@@ -152,9 +152,9 @@ ch_free( void *ptr )
{
void *ctx;
ctx = sl_context( ptr );
ctx = slap_sl_context( ptr );
if (ctx) {
sl_free( ptr, ctx );
slap_sl_free( ptr, ctx );
} else {
ber_memfree_x( ptr, NULL );
}
......
......@@ -986,13 +986,13 @@ connection_operation( void *ctx, void *arg_v )
*/
#if 0
memsiz = ber_len( op->o_ber ) * 64;
if ( SLMALLOC_SLAB_SIZE > memsiz ) memsiz = SLMALLOC_SLAB_SIZE;
if ( SLAP_SLAB_SIZE > memsiz ) memsiz = SLAP_SLAB_SIZE;
#endif
memsiz = SLMALLOC_SLAB_SIZE;
memsiz = SLAP_SLAB_SIZE;
memctx = sl_mem_create( memsiz, ctx );
memctx = slap_sl_mem_create( memsiz, ctx );
op->o_tmpmemctx = memctx;
op->o_tmpmfuncs = &sl_mfuncs;
op->o_tmpmfuncs = &slap_sl_mfuncs;
if ( tag != LDAP_REQ_ADD && tag != LDAP_REQ_MODIFY ) {
/* Note - the ber and its buffer are already allocated from
* regular memory; this only affects subsequent mallocs that
......@@ -1129,9 +1129,9 @@ operations_error:
if ( op->o_cancel != SLAP_CANCEL_ACK &&
( op->o_sync_mode & SLAP_SYNC_PERSIST ) ) {
sl_mem_detach( ctx, memctx );
slap_sl_mem_detach( ctx, memctx );
} else if (( op->o_sync_slog_size != -1 )) {
sl_mem_detach( ctx, memctx );
slap_sl_mem_detach( ctx, memctx );
LDAP_STAILQ_REMOVE( &conn->c_ops, op, slap_op, o_next);
LDAP_STAILQ_NEXT(op, o_next) = NULL;
conn->c_n_ops_executing--;
......@@ -1873,8 +1873,8 @@ connection_fake_init(
conn->c_peer_name = slap_empty_bv;
/* set memory context */
op->o_tmpmemctx = sl_mem_create( SLMALLOC_SLAB_SIZE, ctx );
op->o_tmpmfuncs = &sl_mfuncs;
op->o_tmpmemctx = slap_sl_mem_create( SLAP_SLAB_SIZE, ctx );
op->o_tmpmfuncs = &slap_sl_mfuncs;
op->o_threadctx = ctx;
op->o_conn = conn;
......
......@@ -849,7 +849,7 @@ build_new_dn( struct berval * new_dn,
}
new_dn->bv_len = parent_dn->bv_len + newrdn->bv_len + 1;
new_dn->bv_val = (char *) sl_malloc( new_dn->bv_len + 1, memctx );
new_dn->bv_val = (char *) slap_sl_malloc( new_dn->bv_len + 1, memctx );
ptr = lutil_strcopy( new_dn->bv_val, newrdn->bv_val );
*ptr++ = ',';
......
......@@ -527,7 +527,7 @@ get_ssa(
|| ssa.sa_any != NULL
|| ssa.sa_final.bv_val != NULL )
{
sl_free( nvalue.bv_val, op->o_tmpmemctx );
slap_sl_free( nvalue.bv_val, op->o_tmpmemctx );
goto return_error;
}
......@@ -544,7 +544,7 @@ get_ssa(
#endif
if ( ssa.sa_final.bv_val != NULL ) {
sl_free( nvalue.bv_val, op->o_tmpmemctx );
slap_sl_free( nvalue.bv_val, op->o_tmpmemctx );
goto return_error;
}
......@@ -561,7 +561,7 @@ get_ssa(
#endif
if ( ssa.sa_final.bv_val != NULL ) {
sl_free( nvalue.bv_val, op->o_tmpmemctx );
slap_sl_free( nvalue.bv_val, op->o_tmpmemctx );
goto return_error;
}
......@@ -580,7 +580,7 @@ get_ssa(
#endif
assert( 0 );
sl_free( nvalue.bv_val, op->o_tmpmemctx );
slap_sl_free( nvalue.bv_val, op->o_tmpmemctx );
return_error:
#ifdef NEW_LOGGING
......@@ -591,9 +591,9 @@ return_error:
Debug( LDAP_DEBUG_FILTER, " error=%ld\n",
(long) rc, 0, 0 );
#endif
sl_free( ssa.sa_initial.bv_val, op->o_tmpmemctx );
slap_sl_free( ssa.sa_initial.bv_val, op->o_tmpmemctx );
ber_bvarray_free_x( ssa.sa_any, op->o_tmpmemctx );
sl_free( ssa.sa_final.bv_val, op->o_tmpmemctx );
slap_sl_free( ssa.sa_final.bv_val, op->o_tmpmemctx );
return rc;
}
......@@ -681,8 +681,8 @@ filter_free( Filter *f )
{
Operation op;
op.o_tmpmemctx = sl_context( f );
op.o_tmpmfuncs = &sl_mfuncs;
op.o_tmpmemctx = slap_sl_context( f );
op.o_tmpmfuncs = &slap_sl_mfuncs;
filter_free_x( &op, f );
}
......@@ -927,7 +927,7 @@ filter_escape_value_x(
assert( out );
i = in->bv_len * 3 + 1;
out->bv_val = ctx ? sl_malloc( i, ctx ) : ch_malloc( i );
out->bv_val = ctx ? slap_sl_malloc( i, ctx ) : ch_malloc( i );
out->bv_len = 0;
for( i=0; i < in->bv_len ; i++ ) {
......
......@@ -59,7 +59,7 @@ slap_build_sync_state_ctrl(
ber_init2( ber, 0, LBER_USE_DER );
ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
ctrls[num_ctrls] = sl_malloc ( sizeof ( LDAPControl ), op->o_tmpmemctx );
ctrls[num_ctrls] = slap_sl_malloc ( sizeof ( LDAPControl ), op->o_tmpmemctx );
for ( a = e->e_attrs; a != NULL; a = a->a_next ) {
AttributeDescription *desc = a->a_desc;
......
......@@ -208,7 +208,7 @@ int main( int argc, char **argv )
char *serverNamePrefix = "";
size_t l;
sl_mem_init();
slap_sl_mem_init();
serverName = lutil_progname( "slapd", argc, argv );
......
......@@ -93,7 +93,7 @@ slap_op_free( Operation *op )
GroupAssertion *g, *n;
for (g = op->o_groups; g; g=n) {
n = g->ga_next;
sl_free(g, op->o_tmpmemctx);
slap_sl_free(g, op->o_tmpmemctx);
}
op->o_groups = NULL;
}
......
......@@ -1097,16 +1097,22 @@ LDAP_SLAPD_F (int) slap_add_session_log LDAP_P((
/*
* sl_malloc.c
*/
LDAP_SLAPD_V (BerMemoryFunctions) sl_mfuncs;
LDAP_SLAPD_F (void *) sl_malloc LDAP_P(( ber_len_t size, void *ctx ));
LDAP_SLAPD_F (void *) sl_realloc LDAP_P(( void *block, ber_len_t size, void *ctx ));
LDAP_SLAPD_F (void *) sl_calloc LDAP_P(( ber_len_t nelem, ber_len_t size, void *ctx ));
LDAP_SLAPD_F (void) sl_free LDAP_P(( void *, void *ctx ));
LDAP_SLAPD_F (void) sl_mem_init LDAP_P(( void ));
LDAP_SLAPD_F (void *) sl_mem_create LDAP_P(( ber_len_t size, void *ctx ));
LDAP_SLAPD_F (void) sl_mem_detach LDAP_P(( void *ctx, void *memctx ));
LDAP_SLAPD_F (void) sl_mem_destroy LDAP_P(( void *key, void *data ));
LDAP_SLAPD_F (void *) sl_context LDAP_P(( void *ptr ));
LDAP_SLAPD_F (void *) slap_sl_malloc LDAP_P((
ber_len_t size, void *ctx ));
LDAP_SLAPD_F (void *) slap_sl_realloc LDAP_P((
void *block, ber_len_t size, void *ctx ));
LDAP_SLAPD_F (void *) slap_sl_calloc LDAP_P((
ber_len_t nelem, ber_len_t size, void *ctx ));
LDAP_SLAPD_F (void) slap_sl_free LDAP_P((
void *, void *ctx ));
LDAP_SLAPD_V (BerMemoryFunctions) slap_sl_mfuncs;
LDAP_SLAPD_F (void) slap_sl_mem_init LDAP_P(( void ));
LDAP_SLAPD_F (void *) slap_sl_mem_create LDAP_P(( ber_len_t size, void *ctx ));
LDAP_SLAPD_F (void) slap_sl_mem_detach LDAP_P(( void *ctx, void *memctx ));
LDAP_SLAPD_F (void) slap_sl_mem_destroy LDAP_P(( void *key, void *data ));
LDAP_SLAPD_F (void *) slap_sl_context LDAP_P(( void *ptr ));
/*
* starttls.c
......
......@@ -858,15 +858,15 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
size = i * sizeof(char *) + k;
if ( size > 0 ) {
char *a_flags;
e_flags = sl_calloc ( 1, i * sizeof(char *) + k, op->o_tmpmemctx );
e_flags = slap_sl_calloc ( 1, i * sizeof(char *) + k, op->o_tmpmemctx );
if( e_flags == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,
"send_search_entry: conn %lu sl_calloc failed\n",
"send_search_entry: conn %lu slap_sl_calloc failed\n",
op->o_connid ? op->o_connid : 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"send_search_entry: sl_calloc failed\n", 0, 0, 0 );
"send_search_entry: slap_sl_calloc failed\n", 0, 0, 0 );
#endif
ber_free( ber, 1 );
......@@ -1049,7 +1049,7 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
* Reuse previous memory - we likely need less space
* for operational attributes
*/
tmp = sl_realloc( e_flags, i * sizeof(char *) + k,
tmp = slap_sl_realloc( e_flags, i * sizeof(char *) + k,
op->o_tmpmemctx );
if ( tmp == NULL ) {
#ifdef NEW_LOGGING
......@@ -1255,7 +1255,7 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
/* free e_flags */
if ( e_flags ) {
sl_free( e_flags, op->o_tmpmemctx );
slap_sl_free( e_flags, op->o_tmpmemctx );
e_flags = NULL;
}
......@@ -1349,7 +1349,7 @@ error_return:;
rs->sr_flags &= ~REP_ENTRY_MUSTBEFREED;
}
if ( e_flags ) sl_free( e_flags, op->o_tmpmemctx );
if ( e_flags ) slap_sl_free( e_flags, op->o_tmpmemctx );
if (op->o_callback) {
slap_callback *sc = op->o_callback;
......@@ -1664,7 +1664,7 @@ int slap_read_controls(
c.ldctl_oid = oid->bv_val;
c.ldctl_iscritical = 0;
*ctrl = sl_calloc( 1, sizeof(LDAPControl), NULL );
*ctrl = slap_sl_calloc( 1, sizeof(LDAPControl), NULL );
**ctrl = c;
return LDAP_SUCCESS;
}
......
......@@ -1815,7 +1815,7 @@ int slap_sasl_getdn( Connection *conn, Operation *op, struct berval *id,
}
/* Build the new dn */
dn->bv_val = sl_malloc( len + 1, op->o_tmpmemctx );
dn->bv_val = slap_sl_malloc( len + 1, op->o_tmpmemctx );
if( dn->bv_val == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( TRANSPORT, ERR,
......@@ -1861,7 +1861,7 @@ int slap_sasl_getdn( Connection *conn, Operation *op, struct berval *id,
rc = dnNormalize( 0, NULL, NULL, dn, &dn2, op->o_tmpmemctx );
/* User DNs were constructed above and must be freed now */
sl_free( dn->bv_val, op->o_tmpmemctx );
slap_sl_free( dn->bv_val, op->o_tmpmemctx );
if ( rc != LDAP_SUCCESS ) {
BER_BVZERO( dn );
......@@ -1873,7 +1873,7 @@ int slap_sasl_getdn( Connection *conn, Operation *op, struct berval *id,
/* Run thru regexp */
slap_sasl2dn( op, dn, &dn2, flags );
if( !BER_BVISNULL( &dn2 ) ) {
sl_free( dn->bv_val, op->o_tmpmemctx );
slap_sl_free( dn->bv_val, op->o_tmpmemctx );
*dn = dn2;
#ifdef NEW_LOGGING
LDAP_LOG( TRANSPORT, ENTRY,
......
......@@ -562,7 +562,7 @@ static void slap_sasl_rx_exp(
len += str[i].rm_eo - str[i].rm_so;
n++;
}
out->bv_val = sl_malloc( len + 1, ctx );
out->bv_val = slap_sl_malloc( len + 1, ctx );
out->bv_len = len;
/* Fill in URI with replace string, replacing $i as we go */
......@@ -902,7 +902,7 @@ exact_match:
CONCLUDED:
if( op.o_req_dn.bv_len ) ch_free( op.o_req_dn.bv_val );
if( op.o_req_ndn.bv_len ) sl_free( op.o_req_ndn.bv_val, opx->o_tmpmemctx );
if( op.o_req_ndn.bv_len ) slap_sl_free( op.o_req_ndn.bv_val, opx->o_tmpmemctx );
if( op.oq_search.rs_filter ) filter_free_x( opx, op.oq_search.rs_filter );
if( op.ors_filterstr.bv_len ) ch_free( op.ors_filterstr.bv_val );
......@@ -1014,7 +1014,7 @@ void slap_sasl2dn( Operation *opx,
rc = slap_parseURI( opx, &regout, &op.o_req_dn,
&op.o_req_ndn, &op.oq_search.rs_scope, &op.oq_search.rs_filter,
&op.ors_filterstr );
if ( !BER_BVISNULL( &regout ) ) sl_free( regout.bv_val, opx->o_tmpmemctx );
if ( !BER_BVISNULL( &regout ) ) slap_sl_free( regout.bv_val, opx->o_tmpmemctx );
if ( rc != LDAP_SUCCESS ) {
goto FINISHED;
}
......@@ -1093,8 +1093,8 @@ FINISHED:
if( !BER_BVISEMPTY( sasldn ) ) {
opx->o_conn->c_authz_backend = op.o_bd;
}
if( !BER_BVISNULL( &op.o_req_dn ) ) sl_free( op.o_req_dn.bv_val, opx->o_tmpmemctx );
if( !BER_BVISNULL( &op.o_req_ndn ) ) sl_free( op.o_req_ndn.bv_val, opx->o_tmpmemctx );
if( !BER_BVISNULL( &op.o_req_dn ) ) slap_sl_free( op.o_req_dn.bv_val, opx->o_tmpmemctx );
if( !BER_BVISNULL( &op.o_req_ndn ) ) slap_sl_free( op.o_req_ndn.bv_val, opx->o_tmpmemctx );
if( op.oq_search.rs_filter ) filter_free_x( opx, op.oq_search.rs_filter );
if( !BER_BVISNULL( &op.ors_filterstr ) ) ch_free( op.ors_filterstr.bv_val );
......
......@@ -177,7 +177,7 @@ int octetStringIndexer(
/* we should have at least one value at this point */
assert( i > 0 );
keys = sl_malloc( sizeof( struct berval ) * (i+1), ctx );
keys = slap_sl_malloc( sizeof( struct berval ) * (i+1), ctx );
slen = syntax->ssyn_oidlen;
mlen = mr->smr_oidlen;
......@@ -231,7 +231,7 @@ int octetStringFilter(
slen = syntax->ssyn_oidlen;
mlen = mr->smr_oidlen;
keys = sl_malloc( sizeof( struct berval ) * 2, ctx );
keys = slap_sl_malloc( sizeof( struct berval ) * 2, ctx );
HASH_Init( &HASHcontext );
if( prefix != NULL && prefix->bv_len > 0 ) {
......@@ -440,7 +440,7 @@ octetStringSubstringsIndexer(
return LDAP_SUCCESS;
}
keys = sl_malloc( sizeof( struct berval ) * (nkeys+1), ctx );
keys = slap_sl_malloc( sizeof( struct berval ) * (nkeys+1), ctx );
slen = syntax->ssyn_oidlen;
mlen = mr->smr_oidlen;
......@@ -597,7 +597,7 @@ octetStringSubstringsFilter (
slen = syntax->ssyn_oidlen;
mlen = mr->smr_oidlen;
keys = sl_malloc( sizeof( struct berval ) * (nkeys+1), ctx );
keys = slap_sl_malloc( sizeof( struct berval ) * (nkeys+1), ctx );
nkeys = 0;
if( flags & SLAP_INDEX_SUBSTR_INITIAL && sa->sa_initial.bv_val != NULL &&
......@@ -823,7 +823,7 @@ nameUIDPretty(
if( rc != LDAP_SUCCESS ) return rc;
if( uidval.bv_val ) {
char *tmp = sl_realloc( out->bv_val, out->bv_len + uidval.bv_len + 2, ctx );
char *tmp = slap_sl_realloc( out->bv_val, out->bv_len + uidval.bv_len + 2, ctx );
int i, c, got1;
if( tmp == NULL ) {
ber_memfree_x( out->bv_val, ctx );
......@@ -1482,7 +1482,7 @@ telephoneNumberNormalize(
/* validator should have refused an empty string */
assert( val->bv_len );
q = normalized->bv_val = sl_malloc( val->bv_len + 1, ctx );
q = normalized->bv_val = slap_sl_malloc( val->bv_len + 1, ctx );
for( p = val->bv_val; *p; p++ ) {
if ( ! ( ASCII_SPACE( *p ) || *p == '-' )) {
......@@ -1494,7 +1494,7 @@ telephoneNumberNormalize(
normalized->bv_len = q - normalized->bv_val;
if( normalized->bv_len == 0 ) {
sl_free( normalized->bv_val, ctx );
slap_sl_free( normalized->bv_val, ctx );
normalized->bv_val = NULL;
return LDAP_INVALID_SYNTAX;
}
......@@ -1771,7 +1771,7 @@ IA5StringNormalize(
normalized->bv_len = q - normalized->bv_val;
if( normalized->bv_len == 0 ) {
normalized->bv_val = sl_realloc( normalized->bv_val, 2, ctx );
normalized->bv_val = slap_sl_realloc( normalized->bv_val, 2, ctx );
normalized->bv_val[0] = ' ';
normalized->bv_val[1] = '\0';
normalized->bv_len = 1;
......@@ -1824,7 +1824,7 @@ UUIDNormalize(
int i;
int j;
normalized->bv_len = 16;
normalized->bv_val = sl_malloc( normalized->bv_len+1, ctx );
normalized->bv_val = slap_sl_malloc( normalized->bv_len+1, ctx );
for( i=0, j=0; i<36; i++ ) {
unsigned char nibble;
......@@ -1841,7 +1841,7 @@ UUIDNormalize(
nibble = val->bv_val[i] - ('A'-10);
} else {
sl_free( normalized->bv_val, ctx );
slap_sl_free( normalized->bv_val, ctx );
return LDAP_INVALID_SYNTAX;
}
......@@ -1892,7 +1892,7 @@ numericStringNormalize(
assert( val->bv_len );
normalized->bv_val = sl_malloc( val->bv_len + 1, ctx );
normalized->bv_val = slap_sl_malloc( val->bv_len + 1, ctx );
p = val->bv_val;
q = normalized->bv_val;
......@@ -1915,7 +1915,7 @@ numericStringNormalize(
normalized->bv_len = q - normalized->bv_val;
if( normalized->bv_len == 0 ) {
normalized->bv_val = sl_realloc( normalized->bv_val, 2, ctx );
normalized->bv_val = slap_sl_realloc( normalized->bv_val, 2, ctx );
normalized->bv_val[0] = ' ';
normalized->bv_val[1] = '\0';
normalized->bv_len = 1;
......@@ -2083,10 +2083,10 @@ serialNumberAndIssuerPretty(
/* make room from sn + "$" */
out->bv_len = sn.bv_len + newi.bv_len + 1;
out->bv_val = sl_realloc( newi.bv_val, out->bv_len + 1, ctx );
out->bv_val = slap_sl_realloc( newi.bv_val, out->bv_len + 1, ctx );
if( out->bv_val == NULL ) {
sl_free( newi.bv_val, ctx );
slap_sl_free( newi.bv_val, ctx );
return LDAP_OTHER;
}
......@@ -2170,10 +2170,10 @@ serialNumberAndIssuerNormalize(
/* make room from sn + "$" */
out->bv_len = sn.bv_len + newi.bv_len + 1;
out->bv_val = sl_realloc( newi.bv_val, out->bv_len + 1, ctx );
out->bv_val = slap_sl_realloc( newi.bv_val, out->bv_len + 1, ctx );
if( out->bv_val == NULL ) {
sl_free( newi.bv_val, ctx );
slap_sl_free( newi.bv_val, ctx );
return LDAP_OTHER;
}
......@@ -2516,7 +2516,7 @@ generalizedTimeNormalize(
}
len = sizeof("YYYYmmddHHMMSSZ")-1 + fraction.bv_len;
normalized->bv_val = sl_malloc( len + 1, ctx );
normalized->bv_val = slap_sl_malloc( len + 1, ctx );
if ( normalized->bv_val == NULL ) {
return LBER_ERROR_MEMORY;
}
......
......@@ -115,7 +115,7 @@ static int objectSubClassIndexer(
}
/* over allocate */
ocvalues = sl_malloc( sizeof( struct berval ) * (noc+16), ctx );
ocvalues = slap_sl_malloc( sizeof( struct berval ) * (noc+16), ctx );
/* copy listed values (and termination) */
for( i=0; i<noc; i++ ) {
......@@ -149,7 +149,7 @@ static int objectSubClassIndexer(
}
if( !found ) {
ocvalues = sl_realloc( ocvalues,
ocvalues = slap_sl_realloc( ocvalues,
sizeof( struct berval ) * (noc+2), ctx );
assert( k == noc );
......@@ -170,7 +170,7 @@ static int objectSubClassIndexer(
rc = octetStringIndexer( use, mask, syntax, mr,
prefix, ocvalues, keysp, ctx );
sl_free( ocvalues, ctx );
slap_sl_free( ocvalues, ctx );
return rc;
}
......
......@@ -335,8 +335,8 @@ do_search(
}
if( !op->o_req_ndn.bv_len && default_search_nbase.bv_len ) {
sl_free( op->o_req_dn.bv_val, op->o_tmpmemctx );
sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
slap_sl_free( op->o_req_dn.bv_val, op->o_tmpmemctx );
slap_sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
ber_dupbv_x( &op->o_req_dn, &default_search_base, op->o_tmpmemctx );
ber_dupbv_x( &op->o_req_ndn, &default_search_nbase, op->o_tmpmemctx );
......@@ -419,8 +419,8 @@ return_results:;