udp: Fix resource leaks in an error path in udp6_send()

Reported by:	Andrew Griffiths <andrew@calif.io>
Fixes:		069a67374e ("ip6: Remove support for RFC2675 (Jumbo Payload Option)")
Reviewed by:	pouria, tuexen, glebius
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D57341
This commit is contained in:
Mark Johnston
2026-06-05 21:48:35 +00:00
parent c2631d1623
commit 520e0f576f
+2 -4
View File
@@ -862,11 +862,9 @@ udp6_send(struct socket *so, int flags_arg, struct mbuf *m,
ulen = m->m_pkthdr.len;
plen = sizeof(struct udphdr) + ulen;
hlen = sizeof(struct ip6_hdr);
if (plen > IPV6_MAXPAYLOAD) {
m_freem(control);
m_freem(m);
return (EMSGSIZE);
error = EMSGSIZE;
goto release;
}
/*