From: Julius Enarusai Date: Tue, 19 Nov 2002 20:20:00 +0000 (+0000) Subject: Converted ch_malloc and ch_calloc calls to SLAP_MALLOC and SLAP_CALLOC. X-Git-Tag: NO_SLAP_OP_BLOCKS~794 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3fddf93a7bdb21a055dda7bf7936dbb596c4bfd4;p=openldap Converted ch_malloc and ch_calloc calls to SLAP_MALLOC and SLAP_CALLOC. --- diff --git a/servers/slapd/oidm.c b/servers/slapd/oidm.c index a244d18b9b..4075171d13 100644 --- a/servers/slapd/oidm.c +++ b/servers/slapd/oidm.c @@ -43,8 +43,18 @@ oidm_find(char *oid) if( pos ) { int suflen = strlen(oid + pos); - char *tmp = ch_malloc( om->som_oid.bv_len + char *tmp = SLAP_MALLOC( om->som_oid.bv_len + suflen + 1); + if( tmp == NULL ) { +#ifdef NEW_LOGGING + LDAP_LOG( OPERATION, ERR, + "oidm_find: SLAP_MALLOC failed", 0, 0, 0 ); +#else + Debug( LDAP_DEBUG_ANY, + "oidm_find: SLAP_MALLOC failed", 0, 0, 0 ); +#endif + return NULL; + } strcpy(tmp, om->som_oid.bv_val); if( suflen ) { suflen = om->som_oid.bv_len; @@ -98,7 +108,15 @@ usage: fprintf( stderr, "\tObjectIdentifier \n"); return 1; } - om = (OidMacro *) ch_malloc( sizeof(OidMacro) ); + om = (OidMacro *) SLAP_MALLOC( sizeof(OidMacro) ); + if( om == NULL ) { +#ifdef NEW_LOGGING + LDAP_LOG( OPERATION, ERR, "parse_oidm: SLAP_MALLOC failed", 0, 0, 0 ); +#else + Debug( LDAP_DEBUG_ANY, "parse_oidm: SLAP_MALLOC failed", 0, 0, 0 ); +#endif + return 1; + } om->som_names = NULL; ldap_charray_add( &om->som_names, argv[1] );