1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-22 11:17:19 +00:00

mail(1): check for out of memory conditions when calling calloc(3).

X-MFC with:	r302771
This commit is contained in:
Pedro F. Giffuni 2016-07-14 15:09:08 +00:00
parent 4cefe96c6d
commit 20a50e9ca9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=302845

View File

@ -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;