Commit 0c76956f authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

[C_ALLOCA] (xmalloc): New function.

parent b0f661de
......@@ -137,6 +137,23 @@ quote_file_name (name)
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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment