about summary refs log tree commit diff
path: root/mthread.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2019-05-03 16:36:08 +0200
committerLeah Neukirchen <leah@vuxu.org>2019-05-03 16:36:08 +0200
commita60e705e51b4fe3d3c5462b53b41359d556ea32c (patch)
tree9402a70dcc35bd19ac4bae32e9134c48bdc46349 /mthread.c
parent5fa9a7a7066cce6f660a97790a160942db2b299a (diff)
downloadmblaze-a60e705e51b4fe3d3c5462b53b41359d556ea32c.tar.gz
mblaze-a60e705e51b4fe3d3c5462b53b41359d556ea32c.tar.xz
mblaze-a60e705e51b4fe3d3c5462b53b41359d556ea32c.zip
mthread: make malloc failure fatal
Diffstat (limited to 'mthread.c')
-rw-r--r--mthread.c6
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;