From 8669824fd59f6ee994a0eedc0d04afb53d8e1ae1 Mon Sep 17 00:00:00 2001 From: Julius Enarusai Date: Fri, 8 Nov 2002 18:17:21 +0000 Subject: [PATCH] Converted ch_calloc calls to SLAP_CALLOC. --- servers/slapd/syntax.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/servers/slapd/syntax.c b/servers/slapd/syntax.c index dbdd14618d..f12dd14012 100644 --- a/servers/slapd/syntax.c +++ b/servers/slapd/syntax.c @@ -94,7 +94,16 @@ syn_insert( if ( ssyn->ssyn_oid ) { sir = (struct sindexrec *) - ch_calloc( 1, sizeof(struct sindexrec) ); + SLAP_CALLOC( 1, sizeof(struct sindexrec) ); + if( sir == NULL ) { +#ifdef NEW_LOGGING + LDAP_LOG( OPERATION, ERR, + "syn_insert: SLAP_CALLOC Error\n", 0, 0, 0 ); +#else + Debug( LDAP_DEBUG_ANY, "SLAP_CALLOC Error\n", 0, 0, 0 ); +#endif + return LDAP_OTHER; + } sir->sir_name = ssyn->ssyn_oid; sir->sir_syn = ssyn; if ( avl_insert( &syn_index, (caddr_t) sir, @@ -120,7 +129,16 @@ syn_add( Syntax *ssyn; int code; - ssyn = (Syntax *) ch_calloc( 1, sizeof(Syntax) ); + ssyn = (Syntax *) SLAP_CALLOC( 1, sizeof(Syntax) ); + if( ssyn == NULL ) { +#ifdef NEW_LOGGING + LDAP_LOG( OPERATION, ERR, + "syn_add: SLAP_CALLOC Error\n", 0, 0, 0 ); +#else + Debug( LDAP_DEBUG_ANY, "SLAP_CALLOC Error\n", 0, 0, 0 ); +#endif + return LDAP_OTHER; + } AC_MEMCPY( &ssyn->ssyn_syn, syn, sizeof(LDAPSyntax) ); -- 2.39.5