[Slirp] [Git][slirp/libslirp][memory_leaks] m_free: remove the M_EXT flag after freeing the mbuf extended buffer

jeremy marchand gitlab at gitlab.freedesktop.org
Thu Feb 18 16:57:28 UTC 2021



jeremy marchand pushed to branch memory_leaks at slirp / libslirp


Commits:
0f11959a by jeremy marchand at 2021-02-18T17:56:37+01:00
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.

- - - - -


1 changed file:

- src/mbuf.c


Changes:

=====================================
src/mbuf.c
=====================================
@@ -38,6 +38,7 @@ void m_cleanup_list(struct quehead *list_head)
         next = m->m_next;
         if (m->m_flags & M_EXT) {
             g_free(m->m_ext);
+            m->m_flags &= ~M_EXT;
         }
         g_free(m);
         m = next;



View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/commit/0f11959aff78e2978ad4763f9ccffce44b83dbf7

-- 
View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/commit/0f11959aff78e2978ad4763f9ccffce44b83dbf7
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/slirp/attachments/20210218/9b433db8/attachment.htm>


More information about the Slirp mailing list