summaryrefslogtreecommitdiffstats
path: root/sys/netinet/udp_usrreq.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-08-12 01:34:27 +0000
committerrwatson <rwatson@FreeBSD.org>2004-08-12 01:34:27 +0000
commitc1da6419476db757367e9a9206649b5e816070d0 (patch)
tree09f51ecb7b8b99b39267ee18093d5f686e5a283f /sys/netinet/udp_usrreq.c
parentd06adac9a43342fc274c3d0fa4b58e4725d45330 (diff)
downloadFreeBSD-src-c1da6419476db757367e9a9206649b5e816070d0.zip
FreeBSD-src-c1da6419476db757367e9a9206649b5e816070d0.tar.gz
When udp_send() fails, make sure to free the control mbufs as well as
the data mbuf. This was done in most error cases, but not the case where the inpcb pointer is surprisingly NULL.
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r--sys/netinet/udp_usrreq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index dc95f4bd2..ef084a3 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1072,6 +1072,8 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr,
if (inp == 0) {
INP_INFO_WUNLOCK(&udbinfo);
m_freem(m);
+ if (control != NULL)
+ m_freem(control);
return EINVAL;
}
INP_LOCK(inp);
OpenPOWER on IntegriCloud