Skip site navigation (1)Skip section navigation (2)


| raw e-mail | index | archive | help
    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);
 	}
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?>