When soreceive_generic() hands off an mbuf from buffer,

clear its pointer to next record, since next record
belongs to the buffer, and shouldn't be leaked.

The ng_ksocket(4) used to clear this pointer itself,
but the correct place is here.

Sponsored by:	Nginx, Inc
This commit is contained in:
Gleb Smirnoff 2013-03-29 13:57:55 +00:00
parent 6b1781e3ea
commit a307eb26ed

View File

@ -1860,6 +1860,7 @@ soreceive_generic(struct socket *so, struct sockaddr **psa, struct uio *uio,
nextrecord = m->m_nextpkt;
sbfree(&so->so_rcv, m);
if (mp != NULL) {
m->m_nextpkt = NULL;
*mp = m;
mp = &m->m_next;
so->so_rcv.sb_mb = m = m->m_next;