aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2024-06-11 01:31:08 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2024-06-11 01:31:08 +0000
commitf70581ff7d556aa49a130fa24c876e74b877278c (patch)
treeb7a50ac45c41b532e2cb8b35f4db56f36249da04
parenta3f7b81fdd2205207085ba5d038b402aba748c6e (diff)
downloadsrc-f70581ff7d556aa49a130fa24c876e74b877278c.tar.gz
src-f70581ff7d556aa49a130fa24c876e74b877278c.zip
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 (cherry picked from commit a9b55a66440ce67e545b60f2861badbfc5ec6327)
-rw-r--r--sys/kern/uipc_usrreq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index e54cd01956bf..87b82763b5f1 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -2189,7 +2189,7 @@ unp_disconnect(struct unpcb *unp, struct unpcb *unp2)
if (m != NULL) {
unp_scan(m, unp_freerights);
- m_freem(m);
+ m_freemp(m);
}
}
@@ -3276,7 +3276,7 @@ unp_dispose(struct socket *so)
if (m != NULL) {
unp_scan(m, unp_freerights);
- m_freem(m);
+ m_freemp(m);
}
}