mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Converted ch_malloc and ch_calloc calls to SLAP_MALLOC and SLAP_CALLOC.
This commit is contained in:
parent
3fddf93a7b
commit
614e7d565d
@ -73,7 +73,17 @@ modify_check_duplicates(
|
|||||||
/* count existing values */ ;
|
/* count existing values */ ;
|
||||||
|
|
||||||
if ( numvals < nummods ) {
|
if ( numvals < nummods ) {
|
||||||
nvals = ch_calloc( numvals + 1, sizeof( struct berval ) );
|
nvals = SLAP_CALLOC( numvals + 1, sizeof( struct berval ) );
|
||||||
|
if( nvals == NULL ) {
|
||||||
|
#ifdef NEW_LOGGING
|
||||||
|
LDAP_LOG( OPERATION, ERR,
|
||||||
|
"modify_check_duplicates: SLAP_CALLOC failed", 0, 0, 0 );
|
||||||
|
#else
|
||||||
|
Debug( LDAP_DEBUG_ANY,
|
||||||
|
"modify_check_duplicates: SLAP_CALLOC failed", 0, 0, 0 );
|
||||||
|
#endif
|
||||||
|
goto return_results;
|
||||||
|
}
|
||||||
|
|
||||||
/* normalize the existing values first */
|
/* normalize the existing values first */
|
||||||
for ( j = 0; vals[ j ].bv_val != NULL; j++ ) {
|
for ( j = 0; vals[ j ].bv_val != NULL; j++ ) {
|
||||||
@ -98,7 +108,17 @@ modify_check_duplicates(
|
|||||||
* values and test each new value against them first,
|
* values and test each new value against them first,
|
||||||
* then to other already normalized values
|
* then to other already normalized values
|
||||||
*/
|
*/
|
||||||
nmods = ch_calloc( nummods + 1, sizeof( struct berval ) );
|
nmods = SLAP_CALLOC( nummods + 1, sizeof( struct berval ) );
|
||||||
|
if( nmods == NULL ) {
|
||||||
|
#ifdef NEW_LOGGING
|
||||||
|
LDAP_LOG( OPERATION, ERR,
|
||||||
|
"modify_check_duplicates: SLAP_CALLOC failed", 0, 0, 0 );
|
||||||
|
#else
|
||||||
|
Debug( LDAP_DEBUG_ANY,
|
||||||
|
"modify_check_duplicates: SLAP_CALLOC failed", 0, 0, 0 );
|
||||||
|
#endif
|
||||||
|
goto return_results;
|
||||||
|
}
|
||||||
|
|
||||||
for ( i = 0; mods[ i ].bv_val != NULL; i++ ) {
|
for ( i = 0; mods[ i ].bv_val != NULL; i++ ) {
|
||||||
rc = value_normalize( ad, SLAP_MR_EQUALITY,
|
rc = value_normalize( ad, SLAP_MR_EQUALITY,
|
||||||
@ -430,7 +450,17 @@ modify_delete_values(
|
|||||||
for ( j = 0; a->a_vals[ j ].bv_val != NULL; j++ )
|
for ( j = 0; a->a_vals[ j ].bv_val != NULL; j++ )
|
||||||
/* count existing values */ ;
|
/* count existing values */ ;
|
||||||
|
|
||||||
nvals = (BerVarray)ch_calloc( j + 1, sizeof ( struct berval ) );
|
nvals = (BerVarray)SLAP_CALLOC( j + 1, sizeof ( struct berval ) );
|
||||||
|
if( nvals == NULL ) {
|
||||||
|
#ifdef NEW_LOGGING
|
||||||
|
LDAP_LOG( OPERATION, ERR,
|
||||||
|
"modify_delete_values: SLAP_CALLOC failed", 0, 0, 0 );
|
||||||
|
#else
|
||||||
|
Debug( LDAP_DEBUG_ANY,
|
||||||
|
"modify_delete_values: SLAP_CALLOC failed", 0, 0, 0 );
|
||||||
|
#endif
|
||||||
|
goto return_results;
|
||||||
|
}
|
||||||
|
|
||||||
/* normalize existing values */
|
/* normalize existing values */
|
||||||
for ( j = 0; a->a_vals[ j ].bv_val != NULL; j++ ) {
|
for ( j = 0; a->a_vals[ j ].bv_val != NULL; j++ ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user