diff options
author | 2015-08-17 09:41:24 +0000 | |
---|---|---|
committer | 2015-08-17 09:41:24 +0000 | |
commit | cc70f8b95fe0a8a135f707ad75549af56371e789 (patch) | |
tree | 92df2d279edb044870ddb72e7d2a20b69c57c588 | |
parent | sendmail in ports has it's own rc.d file no need to keep this one (diff) | |
download | wireguard-openbsd-cc70f8b95fe0a8a135f707ad75549af56371e789.tar.xz wireguard-openbsd-cc70f8b95fe0a8a135f707ad75549af56371e789.zip |
Match the free(3) semantic and accept NULL pointers in rtfree(9).
This will simplify upcoming conversions of rt_refcnt-- to rtfree(9).
Such conversions are needed for proper MP refcounting.
ok deraadt@, dlg@
-rw-r--r-- | sys/net/route.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index f2b1be29513..bd95a7378db 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.217 2015/07/18 15:51:16 mpi Exp $ */ +/* $OpenBSD: route.c,v 1.218 2015/08/17 09:41:24 mpi Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -379,7 +379,8 @@ rtfree(struct rtentry *rt) { struct ifaddr *ifa; - KASSERT(rt != NULL); + if (rt == NULL) + return; rt->rt_refcnt--; |