1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00

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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=248884

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;