aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-29 13:10:25 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-29 13:10:25 +0200
commiteb09650bbaa9ad4376677abb37194f436c837847 (patch)
tree75439fe6e53a6e095d264c34bebd5302bf7ba180
parent795b756e5a984fc7f886ba103dc7fb889811d0af (diff)
downloadmblaze-eb09650bbaa9ad4376677abb37194f436c837847.tar.gz
msort: check realloc
-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)