diff options
author | Leah Neukirchen <leah@vuxu.org> | 2019-05-03 16:36:08 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2019-05-03 16:36:08 +0200 |
commit | a60e705e51b4fe3d3c5462b53b41359d556ea32c (patch) | |
tree | 9402a70dcc35bd19ac4bae32e9134c48bdc46349 | |
parent | 5fa9a7a7066cce6f660a97790a160942db2b299a (diff) | |
download | mblaze-a60e705e51b4fe3d3c5462b53b41359d556ea32c.tar.gz mblaze-a60e705e51b4fe3d3c5462b53b41359d556ea32c.tar.xz mblaze-a60e705e51b4fe3d3c5462b53b41359d556ea32c.zip |
mthread: make malloc failure fatal
-rw-r--r-- | mthread.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mthread.c b/mthread.c index 3dbccbb..70b36b3 100644 --- a/mthread.c +++ b/mthread.c @@ -74,10 +74,14 @@ struct container * midcont(char *mid) { struct container key, **result; + if (!mid) + exit(111); key.mid = mid; if (!(result = tfind(&key, &mids, midorder))) { struct container *c = malloc(sizeof (struct container)); + if (!c) + exit(111); c->mid = mid; c->file = 0; c->msg = 0; @@ -281,6 +285,8 @@ void find_roots() { top = malloc(sizeof (struct container)); + if (!top) + exit(111); top->msg = 0; top->date = -1; top->file = 0; |