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:
glebius 2013-03-29 13:57:55 +00:00
parent f412a6fab2
commit 1bccb6e916

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;