summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2008-07-29 21:46:27 +0000
committerderaadt <deraadt@openbsd.org>2008-07-29 21:46:27 +0000
commitff981a0d803d23a6d856b3de7c21cf4cdb2c0bdc (patch)
tree1ff028867a8190adf472ea07b85cb2bdd98e5411
parentIn ahc_free(), which is invoked if attachment fails, do not free() (diff)
downloadwireguard-openbsd-ff981a0d803d23a6d856b3de7c21cf4cdb2c0bdc.tar.xz
wireguard-openbsd-ff981a0d803d23a6d856b3de7c21cf4cdb2c0bdc.zip
when detaching pcbs, also free the v6 output options so that we do not
leak kernel memory for every closed v6 descriptor with certain options set ok otto jsing todd claudio
-rw-r--r--sys/netinet/in_pcb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 87d0e96acb3..c7339429059 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_pcb.c,v 1.101 2008/07/09 20:20:45 djm Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.102 2008/07/29 21:46:27 deraadt Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
@@ -480,9 +480,10 @@ in_pcbdetach(v)
if (inp->inp_route.ro_rt)
rtfree(inp->inp_route.ro_rt);
#ifdef INET6
- if (inp->inp_flags & INP_IPV6)
+ if (inp->inp_flags & INP_IPV6) {
+ ip6_freepcbopts(inp->inp_outputopts6);
ip6_freemoptions(inp->inp_moptions6);
- else
+ } else
#endif
ip_freemoptions(inp->inp_moptions);
#ifdef IPSEC