summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavid <david@openbsd.org>2010-07-02 03:58:48 +0000
committerdavid <david@openbsd.org>2010-07-02 03:58:48 +0000
commitf7c9a51a21dc3f59a3896850c9788336d52a5e9a (patch)
tree6b71ab42b24e4591170fca3df06da7b9e49e4e4a
parentcorrectly init ppr_able in reset, and some others gcc complained about. (diff)
downloadwireguard-openbsd-f7c9a51a21dc3f59a3896850c9788336d52a5e9a.tar.xz
wireguard-openbsd-f7c9a51a21dc3f59a3896850c9788336d52a5e9a.zip
don't reference an item after it has been returned to the pool
an 8 year old bug exposed by recent uvm changes ok thib@ tedu@ deraadt@
-rw-r--r--sys/netinet/ip_spd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/ip_spd.c b/sys/netinet/ip_spd.c
index 876ba82a1ae..e3fd6117317 100644
--- a/sys/netinet/ip_spd.c
+++ b/sys/netinet/ip_spd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_spd.c,v 1.60 2010/01/15 18:20:23 chl Exp $ */
+/* $OpenBSD: ip_spd.c,v 1.61 2010/07/02 03:58:48 david Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
*
@@ -599,11 +599,11 @@ ipsec_delete_policy(struct ipsec_policy *ipo)
if (ipo->ipo_local_auth)
ipsp_reffree(ipo->ipo_local_auth);
- pool_put(&ipsec_policy_pool, ipo);
-
if (!(ipo->ipo_flags & IPSP_POLICY_SOCKET))
ipsec_in_use--;
+ pool_put(&ipsec_policy_pool, ipo);
+
return err;
}