summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgsoares <gsoares@openbsd.org>2014-03-26 13:09:02 +0000
committergsoares <gsoares@openbsd.org>2014-03-26 13:09:02 +0000
commit1324fcd05d0cf4b8f88404ee0378686ec393a554 (patch)
treeca45a8fd17ecf87b053c00750c64ad219e103e17
parentAdd support for retrieving the line and speed from the /etc/remote dv (diff)
downloadwireguard-openbsd-1324fcd05d0cf4b8f88404ee0378686ec393a554.tar.xz
wireguard-openbsd-1324fcd05d0cf4b8f88404ee0378686ec393a554.zip
strdup() returns NULL if out of memory, we should check it.
OK beck@
-rw-r--r--libexec/spamd/spamd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libexec/spamd/spamd.c b/libexec/spamd/spamd.c
index 27a50417100..e3262fbd939 100644
--- a/libexec/spamd/spamd.c
+++ b/libexec/spamd/spamd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spamd.c,v 1.113 2013/11/19 18:33:38 deraadt Exp $ */
+/* $OpenBSD: spamd.c,v 1.114 2014/03/26 13:09:02 gsoares Exp $ */
/*
* Copyright (c) 2002-2007 Bob Beck. All rights reserved.
@@ -669,6 +669,8 @@ initcon(struct con *cp, int fd, struct sockaddr *sa)
if (greylist && blackcount > maxblack)
cp->stutter = 0;
cp->lists = strdup(loglists(cp));
+ if (cp->lists == NULL)
+ err(1, "malloc");
}
else
cp->lists = NULL;