summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2003-09-26 16:07:29 +0000
committerderaadt <deraadt@openbsd.org>2003-09-26 16:07:29 +0000
commit992bbe35d878f054f5a6654111a911a65b1b00dc (patch)
tree9cfec0db55c51cb046d10451e2e352d7c8703f95
parentFix off-by-ones in format string for 's' specifier; millert@, deraadt@ ok (diff)
downloadwireguard-openbsd-992bbe35d878f054f5a6654111a911a65b1b00dc.tar.xz
wireguard-openbsd-992bbe35d878f054f5a6654111a911a65b1b00dc.zip
can free(NULL)
-rw-r--r--libexec/spamd/sdl.c14
-rw-r--r--libexec/spamd/spamd.c8
2 files changed, 7 insertions, 15 deletions
diff --git a/libexec/spamd/sdl.c b/libexec/spamd/sdl.c
index 42f287c770a..f9c1a9fd0b8 100644
--- a/libexec/spamd/sdl.c
+++ b/libexec/spamd/sdl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdl.c,v 1.9 2003/09/20 00:43:10 deraadt Exp $ */
+/* $OpenBSD: sdl.c,v 1.10 2003/09/26 16:07:29 deraadt Exp $ */
/*
* Copyright (c) 2003 Bob Beck. All rights reserved.
*
@@ -253,15 +253,9 @@ sdl_lookup(struct sdlist *head, int af, void * src)
static void
sdl_free(struct sdlist *sdl)
{
- if (sdl->tag != NULL)
- free(sdl->tag);
-
- if (sdl->string != NULL)
- free(sdl->string);
-
- if (sdl->addrs != NULL)
- free(sdl->addrs);
-
+ free(sdl->tag);
+ free(sdl->string);
+ free(sdl->addrs);
sdl_clear(sdl);
}
diff --git a/libexec/spamd/spamd.c b/libexec/spamd/spamd.c
index 3435a12f6d4..bfd7b1c314e 100644
--- a/libexec/spamd/spamd.c
+++ b/libexec/spamd/spamd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spamd.c,v 1.47 2003/09/26 04:42:11 beck Exp $ */
+/* $OpenBSD: spamd.c,v 1.48 2003/09/26 16:07:29 deraadt Exp $ */
/*
* Copyright (c) 2002 Theo de Raadt. All rights reserved.
@@ -940,10 +940,8 @@ main(int argc, char *argv[])
max = MAX(max, con[i].fd);
if (max > omax) {
- if (fdsr)
- free(fdsr);
- if (fdsw)
- free(fdsw);
+ free(fdsr);
+ free(fdsw);
fdsr = (fd_set *)calloc(howmany(max+1, NFDBITS),
sizeof(fd_mask));
if (fdsr == NULL)