mthread: make malloc failure fatal

pull/163/head
Leah Neukirchen 5 years ago
parent 5fa9a7a706
commit a60e705e51

@ -74,10 +74,14 @@ struct container *
midcont(char *mid) midcont(char *mid)
{ {
struct container key, **result; struct container key, **result;
if (!mid)
exit(111);
key.mid = mid; key.mid = mid;
if (!(result = tfind(&key, &mids, midorder))) { if (!(result = tfind(&key, &mids, midorder))) {
struct container *c = malloc(sizeof (struct container)); struct container *c = malloc(sizeof (struct container));
if (!c)
exit(111);
c->mid = mid; c->mid = mid;
c->file = 0; c->file = 0;
c->msg = 0; c->msg = 0;
@ -281,6 +285,8 @@ void
find_roots() find_roots()
{ {
top = malloc(sizeof (struct container)); top = malloc(sizeof (struct container));
if (!top)
exit(111);
top->msg = 0; top->msg = 0;
top->date = -1; top->date = -1;
top->file = 0; top->file = 0;

Loading…
Cancel
Save