summaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-10-30 16:14:53 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-10-30 16:14:53 +0000
commit5f0b61b40f3ba4e78dc68e1ebfa7f5f3e3a09b88 (patch)
treef504da4c086d18b82ce74a7c80ff075ff48b50ba /sys/netinet6
parent3a9ed8e97b4e5f62c3fee5263082206364a755a7 (diff)
Don't do a double free, sys_getsockopt() will take care of freeing the
mbuf allocated by the subroutines. OK kettenis@
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_mroute.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
index 91a8a6d1418..15e5810ccd3 100644
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -298,17 +298,14 @@ ip6_mrouter_set(int cmd, struct socket *so, struct mbuf *m)
int
ip6_mrouter_get(int cmd, struct socket *so, struct mbuf **m)
{
- struct mbuf *mb;
-
if (so != ip6_mrouter) return EACCES;
- *m = mb = m_get(M_WAIT, MT_SOOPTS);
+ *m = m_get(M_WAIT, MT_SOOPTS);
switch (cmd) {
case MRT6_PIM:
- return get_pim6(mb);
+ return get_pim6(*m);
default:
- m_free(mb);
return EOPNOTSUPP;
}
}