summaryrefslogtreecommitdiffstats
path: root/usr.bin/mail/vars.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-07-19 11:28:42 -0300
committerRenato Botelho <renato@netgate.com>2016-07-19 11:28:42 -0300
commitd672f772561b19a87633a38b63c9b6b9ee457a3e (patch)
treeddb56ff0f93f58cbbbe2e088659df322eeb91960 /usr.bin/mail/vars.c
parent0a721af42b1b08f07aac9419590a4906d5b1e8f8 (diff)
parent9a5d5ad86e4479378293a6598ce3e086d8abf1a8 (diff)
downloadFreeBSD-src-d672f772561b19a87633a38b63c9b6b9ee457a3e.zip
FreeBSD-src-d672f772561b19a87633a38b63c9b6b9ee457a3e.tar.gz
Merge remote-tracking branch 'origin/stable/11' into devel-11
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