int i, j;
#ifdef SLAP_NO_SL_MALLOC
- return ber_memalloc_x( size, NULL );
+ newptr = ber_memalloc_x( size, NULL );
+ if ( newptr ) return newptr;
+ assert( 0 );
+ exit( EXIT_FAILURE );
#endif
/* ber_set_option calls us like this */
- if (!ctx) return ber_memalloc_x(size, NULL);
+ if (!ctx) {
+ newptr = ber_memalloc_x( size, NULL );
+ if ( newptr ) return newptr;
+ assert( 0 );
+ exit( EXIT_FAILURE );
+ }
/* round up to doubleword boundary */
size += sizeof(ber_len_t) + pad;
return slap_sl_malloc(size, ctx);
#ifdef SLAP_NO_SL_MALLOC
- return ber_memrealloc_x( ptr, size, NULL );
+ newptr = ber_memrealloc_x( ptr, size, NULL );
+ if ( newptr ) return newptr;
+ assert( 0 );
+ exit( EXIT_FAILURE );
#endif
/* Not our memory? */