aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6/udp6_usrreq.c
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2019-11-12 15:46:28 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2019-11-12 15:46:28 +0000
commita8fe77d877af46bb07e639b2d790aa10fe8c6835 (patch)
tree4645d41abea2e18ed5f2dfa19e3100895211bfa2 /sys/netinet6/udp6_usrreq.c
parent4df8c94283e0981885af288035c1eab720a8476a (diff)
Notes
Diffstat (limited to 'sys/netinet6/udp6_usrreq.c')
-rw-r--r--sys/netinet6/udp6_usrreq.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index 15fdf0cf55976..a5dc68855ec9b 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -394,8 +394,11 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
else
UDP_PROBE(receive, NULL, last,
ip6, last, uh);
- if (udp6_append(last, n, off, fromsa))
+ if (udp6_append(last, n, off, fromsa)) {
+ /* XXX-BZ do we leak m here? */
+ *mp = NULL;
return (IPPROTO_DONE);
+ }
}
INP_RUNLOCK(last);
}
@@ -434,6 +437,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
INP_RUNLOCK(last);
} else
INP_RUNLOCK(last);
+ *mp = NULL;
return (IPPROTO_DONE);
}
/*
@@ -501,6 +505,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
if (V_udp_blackhole)
goto badunlocked;
icmp6_error(m, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_NOPORT, 0);
+ *mp = NULL;
return (IPPROTO_DONE);
}
INP_RLOCK_ASSERT(inp);
@@ -509,6 +514,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
if (up->u_rxcslen == 0 || up->u_rxcslen > ulen) {
INP_RUNLOCK(inp);
m_freem(m);
+ *mp = NULL;
return (IPPROTO_DONE);
}
}
@@ -518,11 +524,13 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
UDP_PROBE(receive, NULL, inp, ip6, inp, uh);
if (udp6_append(inp, m, off, fromsa) == 0)
INP_RUNLOCK(inp);
+ *mp = NULL;
return (IPPROTO_DONE);
badunlocked:
if (m)
m_freem(m);
+ *mp = NULL;
return (IPPROTO_DONE);
}