The branch main has been updated by glebius:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2e5bf7c49fd2b6440ac49dbfe80d4384d3f645f1

commit 2e5bf7c49fd2b6440ac49dbfe80d4384d3f645f1
Author:     Gleb Smirnoff <[email protected]>
AuthorDate: 2022-05-17 17:10:41 +0000
Commit:     Gleb Smirnoff <[email protected]>
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

Reply via email to