# HG changeset patch # User Richard M. Stallman # Date 868476034 0 # Node ID 9c7e0c926ed545e9a2b19d98a435f1c72e55bb48 # Parent cb17c9cd025b197e819c00f5d0def3ebdeaed796 [C_ALLOCA] (xmalloc): New function. diff -r cb17c9cd025b -r 9c7e0c926ed5 lib-src/emacsclient.c --- a/lib-src/emacsclient.c Wed Jul 09 19:03:09 1997 +0000 +++ b/lib-src/emacsclient.c Wed Jul 09 19:20:34 1997 +0000 @@ -137,6 +137,23 @@ return copy; } + +#ifdef C_ALLOCA +/* Like malloc but get fatal error if memory is exhausted. */ + +char * +xmalloc (size) + unsigned int size; +{ + char *result = (char *) malloc (size); + if (result == NULL) + { + perror ("malloc"); + exit (1); + } + return result; +} +#endif /* C_ALLOCA */ #if !defined (HAVE_SOCKETS) && !defined (HAVE_SYSVIPC)