home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xntp3.zip / lib / emalloc.c < prev    next >
C/C++ Source or Header  |  1989-07-18  |  301b  |  20 lines

  1. /*
  2.  * emalloc - return new memory obtained from the system.  Belch if none.
  3.  */
  4. #include <stdio.h>
  5. #include <syslog.h>
  6.  
  7. char *
  8. emalloc(size)
  9.     unsigned int size;
  10. {
  11.     char *mem;
  12.     extern char *malloc();
  13.  
  14.     if ((mem = malloc(size)) == 0) {
  15.         syslog(LOG_ERR, "No more memory!");
  16.         exit(1);
  17.     }
  18.     return mem;
  19. }
  20.