Commit fe569dbb authored by Julius Enarusai's avatar Julius Enarusai
Browse files

Converted ch_malloc and ch_calloc calls to SLAP_MALLOC and SLAP_CALLOC.
parent d9e7a719
......@@ -398,7 +398,17 @@ int slap_sasl_getdn( Connection *conn, char *id, int len,
/* Build the new dn */
c1 = dn->bv_val;
dn->bv_val = ch_malloc( len+1 );
dn->bv_val = SLAP_MALLOC( len+1 );
if( dn->bv_val == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( TRANSPORT, ERR,
"slap_sasl_getdn: SLAP_MALLOC failed", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"slap_sasl_getdn: SLAP_MALLOC failed", 0, 0, 0 );
#endif
return LDAP_OTHER;
}
p = lutil_strcopy( dn->bv_val, "uid=" );
p = lutil_strncopy( p, c1, dn->bv_len );
......@@ -1209,10 +1219,20 @@ int slap_sasl_open( Connection *conn )
session_callbacks =
#if SASL_VERSION_MAJOR >= 2
ch_calloc( 5, sizeof(sasl_callback_t));
SLAP_CALLOC( 5, sizeof(sasl_callback_t));
#else
ch_calloc( 3, sizeof(sasl_callback_t));
SLAP_CALLOC( 3, sizeof(sasl_callback_t));
#endif
if( session_callbacks == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG( TRANSPORT, ERR,
"slap_sasl_open: SLAP_MALLOC failed", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
"slap_sasl_open: SLAP_MALLOC failed", 0, 0, 0 );
#endif
return -1;
}
conn->c_sasl_extra = session_callbacks;
session_callbacks[cb=0].id = SASL_CB_LOG;
......
......@@ -706,7 +706,7 @@ UTF8SubstringsassertionNormalize(
SubstringsAssertion *nsa;
int i;
nsa = (SubstringsAssertion *)ch_calloc( 1, sizeof(SubstringsAssertion) );
nsa = (SubstringsAssertion *)SLAP_CALLOC( 1, sizeof(SubstringsAssertion) );
if( nsa == NULL ) {
return NULL;
}
......@@ -723,7 +723,10 @@ UTF8SubstringsassertionNormalize(
/* empty */
}
nsa->sa_any = (struct berval *)
ch_malloc( (i + 1) * sizeof(struct berval) );
SLAP_MALLOC( (i + 1) * sizeof(struct berval) );
if( nsa->sa_any == NULL ) {
goto err;
}
for( i=0; sa->sa_any[i].bv_val != NULL; i++ ) {
UTF8bvnormalize( &sa->sa_any[i], &nsa->sa_any[i],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment