{
void *new;
- if ( (new = (void *) malloc( size )) == NULL ) {
+ if ( (new = (void *) ber_memalloc( size )) == NULL ) {
fprintf( stderr, "malloc of %lu bytes failed\n",
(long) size );
exit( 1 );
return( ch_malloc( size ) );
}
- if ( (new = (void *) realloc( block, size )) == NULL ) {
+ if ( size == 0 ) {
+ ch_free( block );
+ }
+
+ if ( (new = (void *) ber_memrealloc( block, size )) == NULL ) {
fprintf( stderr, "realloc of %lu bytes failed\n",
(long) size );
exit( 1 );
{
void *new;
- if ( (new = (void *) calloc( nelem, size )) == NULL ) {
+ if ( (new = (void *) ber_memcalloc( nelem, size )) == NULL ) {
fprintf( stderr, "calloc of %lu elems of %lu bytes failed\n",
(long) nelem, (long) size );
exit( 1 );
)
{
if ( p != NULL ) {
- free( p );
+ ber_memfree( p );
}
return;
}
-
+