about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--msort.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/msort.c b/msort.c
index b74371d..e003fb5 100644
--- a/msort.c
+++ b/msort.c
@@ -234,6 +234,8 @@ add(char *file)
 		if (mailalloc < 0)
 			exit(-1);
 		mails = realloc(mails, sizeof (struct mail) * mailalloc);
+		if (!mails)
+			exit(-1);
 		memset(mails+mailalloc/2, 0, sizeof (struct mail) * mailalloc/2);
 	}
 	if (!mails)