summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authormmcc <mmcc@cvs.openbsd.org>2015-12-12 20:04:24 +0000
committermmcc <mmcc@cvs.openbsd.org>2015-12-12 20:04:24 +0000
commit4735ccca4462d5820ad08d28cb8cfd5151eb9d9f (patch)
treece0b744455b18d2ed0d71f6328fc63a57aff22f0 /usr.sbin
parent921ca576c5940a00b46b54ae0bc24d8d1fae52d7 (diff)
Remove NULL-checks before free().
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rdate/ntpleaps.c5
-rw-r--r--usr.sbin/sasyncd/net.c8
-rw-r--r--usr.sbin/sensorsd/sensorsd.c5
-rw-r--r--usr.sbin/ypbind/ypbind.c5
4 files changed, 9 insertions, 14 deletions
diff --git a/usr.sbin/rdate/ntpleaps.c b/usr.sbin/rdate/ntpleaps.c
index 8c9323e5d23..f38d3cf2456 100644
--- a/usr.sbin/rdate/ntpleaps.c
+++ b/usr.sbin/rdate/ntpleaps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntpleaps.c,v 1.13 2014/10/08 04:48:22 deraadt Exp $ */
+/* $OpenBSD: ntpleaps.c,v 1.14 2015/12/12 20:04:23 mmcc Exp $ */
/*
* Copyright (c) 2002 Thorsten Glaser. All rights reserved.
@@ -188,8 +188,7 @@ ntpleaps_read(void)
/* Clean up and activate the table */
close(fd);
- if (leapsecs != NULL)
- free(leapsecs);
+ free(leapsecs);
leapsecs = l;
leapsecs_num = r;
return (0);
diff --git a/usr.sbin/sasyncd/net.c b/usr.sbin/sasyncd/net.c
index 507a7ba3d12..d4d2340b692 100644
--- a/usr.sbin/sasyncd/net.c
+++ b/usr.sbin/sasyncd/net.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: net.c,v 1.22 2015/08/20 22:39:29 deraadt Exp $ */
+/* $OpenBSD: net.c,v 1.23 2015/12/12 20:04:23 mmcc Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
@@ -641,10 +641,8 @@ net_shutdown(void)
free(qm);
}
net_disconnect_peer(p);
- if (p->sa)
- free(p->sa);
- if (p->name)
- free(p->name);
+ free(p->sa);
+ free(p->name);
LIST_REMOVE(p, link);
cfgstate.peercnt--;
free(p);
diff --git a/usr.sbin/sensorsd/sensorsd.c b/usr.sbin/sensorsd/sensorsd.c
index 719df4bca24..8374be81642 100644
--- a/usr.sbin/sensorsd/sensorsd.c
+++ b/usr.sbin/sensorsd/sensorsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sensorsd.c,v 1.58 2015/11/19 06:08:06 deraadt Exp $ */
+/* $OpenBSD: sensorsd.c,v 1.59 2015/12/12 20:04:23 mmcc Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -244,8 +244,7 @@ destroy_sdlim(struct sdlim_t *sdlim)
while ((limit = TAILQ_FIRST(&sdlim->limits)) != NULL) {
TAILQ_REMOVE(&sdlim->limits, limit, entries);
- if (limit->command != NULL)
- free(limit->command);
+ free(limit->command);
free(limit);
}
free(sdlim);
diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c
index 5ab2140774a..e4b78df3d00 100644
--- a/usr.sbin/ypbind/ypbind.c
+++ b/usr.sbin/ypbind/ypbind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypbind.c,v 1.64 2015/08/20 22:39:30 deraadt Exp $ */
+/* $OpenBSD: ypbind.c,v 1.65 2015/12/12 20:04:23 mmcc Exp $ */
/*
* Copyright (c) 1992, 1993, 1996, 1997, 1998 Theo de Raadt <deraadt@openbsd.org>
@@ -536,8 +536,7 @@ main(int argc, char *argv[])
extern void *__svc_fdset;
if (fdsrp == NULL || fdsrl != __svc_fdsetsize) {
- if (fdsrp)
- free(fdsrp);
+ free(fdsrp);
fdsrl = __svc_fdsetsize;
width = __svc_fdsetsize;