1 /*_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
5 * Function:..Alloc-Functions with Error-Handling *
7 * from LDAP3.2 University of Michigan *
9 * Patch: unsigned long --> size_t fuer size-Parameter *
12 * Authors:...Dr. Kurt Spanier & Bernhard Winkler, *
13 * Zentrum fuer Datenverarbeitung, Bereich Entwicklung *
14 * neuer Dienste, Universitaet Tuebingen, GERMANY *
17 * Creation date: Z D D V V *
18 * April 16 1996 Z D D V V *
19 * Last modification: Z D D V V *
20 * December 31 1998 ZZZZ DDD V *
22 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_*/
25 * $Id: ch_malloc.c,v 1.6 1999/09/10 15:01:16 zrnsk01 Exp $
32 #include "ch_malloc_exp.h"
33 #include "support_exp.h"
36 /* ch_malloc.c - malloc routines that test returns from malloc and friends */
38 PUBLIC char * ch_malloc( size )
43 if ( (new = (char *) calloc(1, size )) == NULL ) {
44 if (dosyslog) syslog( LOG_INFO, "malloc of %d bytes failed\n", size );
50 /* end of function: ch_malloc */
52 PUBLIC char * ch_realloc( block, size )
58 if ( block == NULL ) {
59 return( ch_malloc( size ) );
62 if ( (new = (char *) realloc( block, size )) == NULL ) {
63 if (dosyslog) syslog( LOG_INFO, "realloc of %d bytes failed\n", size );
69 /* end of function: ch_realloc */
71 PUBLIC char * ch_calloc( nelem, size )
77 if ( (new = (char *) calloc( nelem, size )) == NULL ) {
78 if (dosyslog) syslog( LOG_INFO, "calloc of %d elems of %d bytes failed\n",
85 /* end of function: ch_calloc */