The branch main has been updated by glebius:

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

commit a9b55a66440ce67e545b60f2861badbfc5ec6327
Author:     Gleb Smirnoff <gleb...@freebsd.org>
AuthorDate: 2024-06-04 00:22:33 +0000
Commit:     Gleb Smirnoff <gleb...@freebsd.org>
CommitDate: 2024-06-04 00:23:06 +0000

    unix: use m_freemp() when disposing unix socket buffers
    
    The new unix/dgram uses m_nextpkt linkage, while the old unix/stream
    uses m_next linkage.  This fixes memory leak.
    
    Diagnosed by:           khng
    Reviewed by:            khng, markj
    PR:                     279467
    Fixes:                  458f475df8e5912609c14208c189414a8255c738
    Differential Revision:  https://reviews.freebsd.org/D45478
    MFC After:              1 week
---
 sys/kern/uipc_usrreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 6e83e2be6f05..0f01afa97878 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -2190,7 +2190,7 @@ unp_disconnect(struct unpcb *unp, struct unpcb *unp2)
 
        if (m != NULL) {
                unp_scan(m, unp_freerights);
-               m_freem(m);
+               m_freemp(m);
        }
 }
 
@@ -3280,7 +3280,7 @@ unp_dispose(struct socket *so)
 
        if (m != NULL) {
                unp_scan(m, unp_freerights);
-               m_freem(m);
+               m_freemp(m);
        }
 }
 

Reply via email to