aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeremy marchand <jeremy.marchand@etu.u-bordeaux.fr>2021-02-18 17:56:37 +0100
committerjeremy marchand <jeremy.marchand@etu.u-bordeaux.fr>2021-02-18 18:56:17 +0100
commitff605089bb8f06808e8a30a0362cc908f42f057c (patch)
treebae6824ae23713ad51cf19109865ddab4bb0ab0e
parent99b3b70af627980ee3490944c702b42fc855ef2a (diff)
downloadslirp-ff605089bb8f06808e8a30a0362cc908f42f057c.zip
slirp-ff605089bb8f06808e8a30a0362cc908f42f057c.tar.gz
slirp-ff605089bb8f06808e8a30a0362cc908f42f057c.tar.bz2
m_free: remove the M_EXT flag after freeing the mbuf extended buffer
mbufs added to the freelist shouldn't keep the M_EXT flag as they can be recycled and the new owner could try to access the freed extended buffer.
-rw-r--r--src/mbuf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mbuf.c b/src/mbuf.c
index 54ec721..e064ee9 100644
--- a/src/mbuf.c
+++ b/src/mbuf.c
@@ -105,6 +105,7 @@ void m_free(struct mbuf *m)
/* If it's M_EXT, free() it */
if (m->m_flags & M_EXT) {
g_free(m->m_ext);
+ m->m_flags &= ~M_EXT;
}
/*
* Either free() it or put it on the free list