diff --git a/usr.bin/mail/vars.c b/usr.bin/mail/vars.c index 8cfc06eacd3c..f3c6659e3fb9 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(1, sizeof(*vp)); + 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;