diff options
author | mmcc <mmcc@cvs.openbsd.org> | 2015-12-23 20:42:21 +0000 |
---|---|---|
committer | mmcc <mmcc@cvs.openbsd.org> | 2015-12-23 20:42:21 +0000 |
commit | 1b2ebce8546fd3540c5518105fb5109a31e5b60f (patch) | |
tree | ac7d03b5cbf0183ee307f61b9ca00bd89b761cc0 /usr.sbin/bgpd | |
parent | 77d1af68527813448d49ac9952215bd0ef497e74 (diff) |
Remove NULL-checks before free(). I think I've almost scrubbed the
entire tree of these...
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/pftable.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.sbin/bgpd/pftable.c b/usr.sbin/bgpd/pftable.c index f934a6533ea..dbfa67517b5 100644 --- a/usr.sbin/bgpd/pftable.c +++ b/usr.sbin/bgpd/pftable.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pftable.c,v 1.8 2015/01/21 21:50:32 deraadt Exp $ */ +/* $OpenBSD: pftable.c,v 1.9 2015/12/23 20:42:20 mmcc Exp $ */ /* * Copyright (c) 2004 Damien Miller <djm@openbsd.org> @@ -160,10 +160,8 @@ pftable_clear_all(void) LIST_FOREACH(pft, &tables, entry) { if (pftable_clear(pft->name) != 0) return (-1); - if (pft->worklist != NULL) { - free(pft->worklist); - pft->worklist = NULL; - } + free(pft->worklist); + pft->worklist = NULL; pft->nalloc = pft->naddrs = 0; pft->what = 0; } @@ -250,8 +248,7 @@ pftable_commit(void) LIST_FOREACH(pft, &tables, entry) { if (pft->what != 0 && pftable_change(pft) != 0) ret = -1; - if (pft->worklist != NULL) - free(pft->worklist); + free(pft->worklist); pft->worklist = NULL; pft->nalloc = pft->naddrs = 0; pft->what = 0; |