Make tcp_usr_send() free the passed mbufs on error in all cases as the

comment to it claims.

Sponsored by:	TCP/IP Optimization Fundraise 2005
This commit is contained in:
Andre Oppermann 2006-09-17 13:39:35 +00:00
parent 78ba57b9e1
commit 7ff0b850a6

View File

@ -800,6 +800,10 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m,
KASSERT(inp != NULL, ("tcp_usr_send: inp == NULL"));
INP_LOCK(inp);
if (inp->inp_vflag & (INP_TIMEWAIT | INP_DROPPED)) {
if (control)
m_freem(control);
if (m)
m_freem(m);
error = EINVAL;
goto out;
}