git: 2e5bf7c49fd2 - main - unix: fix mbuf leak on close of socket with data
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 17 May 2022 17:11:56 UTC
The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=2e5bf7c49fd2b6440ac49dbfe80d4384d3f645f1 commit 2e5bf7c49fd2b6440ac49dbfe80d4384d3f645f1 Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2022-05-17 17:10:41 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2022-05-17 17:10:41 +0000 unix: fix mbuf leak on close of socket with data Fixes: 1f32cef47189403e9e70b1893c731c68b97b964e --- sys/kern/uipc_usrreq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index d4e3b25c5479..556a1de142d4 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -2782,7 +2782,10 @@ unp_dispose(struct socket *so) if (SOCK_IO_RECV_OWNED(so)) SOCK_IO_RECV_UNLOCK(so); - unp_dispose_mbuf(m); + if (m != NULL) { + unp_dispose_mbuf(m); + m_freem(m); + } } static void