Commit 6a326a67 6a326a67e98311bc5ca64c3ed946ec3aeb31b392 by Sergey Poznyakoff

Use mh_err_memory to report low memory diagnostics.

1 parent f75305db
......@@ -97,10 +97,7 @@ mh_argp_parse (int argc, char **argv,
_argc = argc + xargc;
_argv = calloc (_argc+1, sizeof *_argv);
if (!_argv)
{
mh_error (_("not enough memory"));
abort ();
}
mh_err_memory (1);
i = 0;
_argv[i++] = argv[0];
......
......@@ -27,20 +27,14 @@ mh_context_create (char *name, int copy)
mh_context_t *ctx;
ctx = malloc (sizeof (*ctx));
if (!ctx)
{
mu_error (_("not enough memory"));
abort ();
}
mh_err_memory (1);
if (copy)
ctx->name = name;
else
{
ctx->name = strdup (name);
if (!ctx->name)
{
mu_error (_("not enough memory"));
abort ();
}
mh_err_memory (1);
}
ctx->header = NULL;
return ctx;
......
......@@ -31,10 +31,7 @@ _expand (size_t *msgcnt, size_t **msglist, size_t inc)
*msgcnt += inc;
*msglist = realloc (*msglist, (*msgcnt)*sizeof(**msglist));
if (!*msglist)
{
mh_error (_("not enough memory"));
abort ();
}
mh_err_memory (1);
}
/* Fatal error handler */
......@@ -589,10 +586,7 @@ mh_msgset_negate (mailbox_t mbox, mh_msgset_t *msgset)
mailbox_messages_count (mbox, &total);
list = calloc (total, sizeof (list[0]));
if (!list)
{
mh_error (_("not enough memory"));
abort ();
}
mh_err_memory (1);
for (i = 1, msgno = 0; i <= total; i++)
{
......
......@@ -291,7 +291,7 @@ edit (struct mh_whatnow_env *wh, int argc, char **argv, int *status)
xargv = calloc (argc+2, sizeof (*xargv));
if (!xargv)
{
mh_error (_("not enough memory"));
mh_err_memory (0);
return 0;
}
......