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:
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user