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, ...@@ -97,10 +97,7 @@ mh_argp_parse (int argc, char **argv,
97 _argc = argc + xargc; 97 _argc = argc + xargc;
98 _argv = calloc (_argc+1, sizeof *_argv); 98 _argv = calloc (_argc+1, sizeof *_argv);
99 if (!_argv) 99 if (!_argv)
100 { 100 mh_err_memory (1);
101 mh_error (_("not enough memory"));
102 abort ();
103 }
104 101
105 i = 0; 102 i = 0;
106 _argv[i++] = argv[0]; 103 _argv[i++] = argv[0];
......
...@@ -27,20 +27,14 @@ mh_context_create (char *name, int copy) ...@@ -27,20 +27,14 @@ mh_context_create (char *name, int copy)
27 mh_context_t *ctx; 27 mh_context_t *ctx;
28 ctx = malloc (sizeof (*ctx)); 28 ctx = malloc (sizeof (*ctx));
29 if (!ctx) 29 if (!ctx)
30 { 30 mh_err_memory (1);
31 mu_error (_("not enough memory"));
32 abort ();
33 }
34 if (copy) 31 if (copy)
35 ctx->name = name; 32 ctx->name = name;
36 else 33 else
37 { 34 {
38 ctx->name = strdup (name); 35 ctx->name = strdup (name);
39 if (!ctx->name) 36 if (!ctx->name)
40 { 37 mh_err_memory (1);
41 mu_error (_("not enough memory"));
42 abort ();
43 }
44 } 38 }
45 ctx->header = NULL; 39 ctx->header = NULL;
46 return ctx; 40 return ctx;
......
...@@ -31,10 +31,7 @@ _expand (size_t *msgcnt, size_t **msglist, size_t inc) ...@@ -31,10 +31,7 @@ _expand (size_t *msgcnt, size_t **msglist, size_t inc)
31 *msgcnt += inc; 31 *msgcnt += inc;
32 *msglist = realloc (*msglist, (*msgcnt)*sizeof(**msglist)); 32 *msglist = realloc (*msglist, (*msgcnt)*sizeof(**msglist));
33 if (!*msglist) 33 if (!*msglist)
34 { 34 mh_err_memory (1);
35 mh_error (_("not enough memory"));
36 abort ();
37 }
38 } 35 }
39 36
40 /* Fatal error handler */ 37 /* Fatal error handler */
...@@ -589,10 +586,7 @@ mh_msgset_negate (mailbox_t mbox, mh_msgset_t *msgset) ...@@ -589,10 +586,7 @@ mh_msgset_negate (mailbox_t mbox, mh_msgset_t *msgset)
589 mailbox_messages_count (mbox, &total); 586 mailbox_messages_count (mbox, &total);
590 list = calloc (total, sizeof (list[0])); 587 list = calloc (total, sizeof (list[0]));
591 if (!list) 588 if (!list)
592 { 589 mh_err_memory (1);
593 mh_error (_("not enough memory"));
594 abort ();
595 }
596 590
597 for (i = 1, msgno = 0; i <= total; i++) 591 for (i = 1, msgno = 0; i <= total; i++)
598 { 592 {
......
...@@ -291,7 +291,7 @@ edit (struct mh_whatnow_env *wh, int argc, char **argv, int *status) ...@@ -291,7 +291,7 @@ edit (struct mh_whatnow_env *wh, int argc, char **argv, int *status)
291 xargv = calloc (argc+2, sizeof (*xargv)); 291 xargv = calloc (argc+2, sizeof (*xargv));
292 if (!xargv) 292 if (!xargv)
293 { 293 {
294 mh_error (_("not enough memory")); 294 mh_err_memory (0);
295 return 0; 295 return 0;
296 } 296 }
297 297
......