1 /* ch_malloc.c - malloc routines that test returns from malloc and friends */
10 #include <ac/socket.h>
21 if ( (new = (void *) malloc( size )) == NULL ) {
22 Debug( LDAP_DEBUG_ANY, "malloc of %lu bytes failed\n", size, 0, 0 );
37 if ( block == NULL ) {
38 return( ch_malloc( size ) );
41 if ( (new = (void *) realloc( block, size )) == NULL ) {
42 Debug( LDAP_DEBUG_ANY, "realloc of %lu bytes failed\n", size, 0, 0 );
57 if ( (new = (void *) calloc( nelem, size )) == NULL ) {
58 Debug( LDAP_DEBUG_ANY, "calloc of %lu elems of %lu bytes failed\n",
73 if ( (new = strdup( string )) == NULL ) {
74 Debug( LDAP_DEBUG_ANY, "strdup(%s) failed\n", string, 0, 0 );