summaryrefslogtreecommitdiff
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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/mail/vars.c b/usr.bin/mail/vars.c
index a4477122a54..e79ceda8099 100644
--- a/usr.bin/mail/vars.c
+++ b/usr.bin/mail/vars.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vars.c,v 1.7 2001/11/21 15:26:39 millert Exp $ */
+/* $OpenBSD: vars.c,v 1.8 2001/11/21 20:41:56 millert Exp $ */
/* $NetBSD: vars.c,v 1.4 1996/06/08 19:48:45 christos Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static const char sccsid[] = "@(#)vars.c 8.1 (Berkeley) 6/6/93";
#else
-static const char rcsid[] = "$OpenBSD: vars.c,v 1.7 2001/11/21 15:26:39 millert Exp $";
+static const char rcsid[] = "$OpenBSD: vars.c,v 1.8 2001/11/21 20:41:56 millert Exp $";
#endif
#endif /* not lint */
@@ -63,7 +63,8 @@ assign(char *name, char *value)
h = hash(name);
vp = lookup(name);
if (vp == NULL) {
- vp = (struct var *)calloc(sizeof(*vp), 1);
+ if ((vp = (struct var *)calloc(sizeof(*vp), 1)) == NULL)
+ errx(1, "Out of memory");
vp->v_name = vcopy(name);
vp->v_link = variables[h];
variables[h] = vp;