summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/ip6_ipsec.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2008-03-14 11:55:04 +0000
committerbz <bz@FreeBSD.org>2008-03-14 11:55:04 +0000
commit51315b3d89073a6bd52254b32653baa2d1d20e4f (patch)
tree2b4540e1f1a0bc5db01609e2656c9f450460577c /sys/netinet6/ip6_ipsec.c
parentf507f0e4fa09490b9ebafe2650f0d70e6daa51e9 (diff)
downloadFreeBSD-src-51315b3d89073a6bd52254b32653baa2d1d20e4f.zip
FreeBSD-src-51315b3d89073a6bd52254b32653baa2d1d20e4f.tar.gz
Correct reference counting on the SP for outgoing IPv6 IPsec connections.
PR: 121374 Reported by: Cyrus Rahman (crahman gmail.com) Tested by: Cyrus Rahman (crahman gmail.com) MFC after: 5 days
Diffstat (limited to 'sys/netinet6/ip6_ipsec.c')
-rw-r--r--sys/netinet6/ip6_ipsec.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sys/netinet6/ip6_ipsec.c b/sys/netinet6/ip6_ipsec.c
index 5d0dea5..cb012c9 100644
--- a/sys/netinet6/ip6_ipsec.c
+++ b/sys/netinet6/ip6_ipsec.c
@@ -257,7 +257,7 @@ ip6_ipsec_output(struct mbuf **m, struct inpcb *inp, int *flags, int *error,
* NB: null pointer to avoid free at
* done: below.
*/
- KEY_FREESP(sp), sp = NULL;
+ KEY_FREESP(sp), *sp = NULL;
/* XXX splx(s); */
goto done;
}
@@ -298,16 +298,10 @@ ip6_ipsec_output(struct mbuf **m, struct inpcb *inp, int *flags, int *error,
}
}
done:
- if (sp != NULL)
- if (*sp != NULL)
- KEY_FREESP(sp);
return 0;
do_ipsec:
return -1;
bad:
- if (sp != NULL)
- if (*sp != NULL)
- KEY_FREESP(sp);
return 1;
#endif /* IPSEC */
return 0;
OpenPOWER on IntegriCloud