- p = 0;
- if (n == 0)
- p = malloc ((size_t) 1);
- if (p == 0)
- error (xmalloc_exit_failure, 0, gettext ("Memory exhausted"));
- return p;
+void
+xalloc_die (void)
+{
+ if (xalloc_fail_func)
+ (*xalloc_fail_func) ();
+ error (xalloc_exit_failure, 0, "%s", _(xalloc_msg_memory_exhausted));
+ /* The `noreturn' cannot be given to error, since it may return if
+ its first argument is 0. To help compilers understand the
+ xalloc_die does terminate, call exit. */
+ exit (EXIT_FAILURE);