summaryrefslogtreecommitdiffstats
path: root/usr.bin/mail/vars.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/mail/vars.c')
-rw-r--r--usr.bin/mail/vars.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/mail/vars.c b/usr.bin/mail/vars.c
index dca0604..f3c6659 100644
--- a/usr.bin/mail/vars.c
+++ b/usr.bin/mail/vars.c
@@ -56,7 +56,8 @@ assign(const char *name, const char *value)
h = hash(name);
vp = lookup(name);
if (vp == NULL) {
- vp = calloc(sizeof(*vp), 1);
+ if ((vp = calloc(1, sizeof(*vp))) == NULL)
+ err(1, "Out of memory");
vp->v_name = vcopy(name);
vp->v_link = variables[h];
variables[h] = vp;
OpenPOWER on IntegriCloud