diff options
author | jeremy marchand <jeremy.marchand@etu.u-bordeaux.fr> | 2021-02-18 14:28:40 +0100 |
---|---|---|
committer | jeremy marchand <jeremy.marchand@etu.u-bordeaux.fr> | 2021-02-18 14:28:40 +0100 |
commit | ec1dfcef5b3748df96ae464ad5be935a91d1b319 (patch) | |
tree | 693679dcd8194f733a5da2a0e60ac0df5a7956cb /src | |
parent | 99b3b70af627980ee3490944c702b42fc855ef2a (diff) | |
download | slirp-memory_leaks.zip slirp-memory_leaks.tar.gz slirp-memory_leaks.tar.bz2 |
m_cleanup: fix memory leaksmemory_leaks
m_cleanup didn't cleanup the if_batchq and if_fastq queues, resulting in
a memory leak (reported by ASAN while fuzzing).
Diffstat (limited to 'src')
-rw-r--r-- | src/mbuf.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -48,6 +48,18 @@ void m_cleanup(Slirp *slirp) g_free(m); m = next; } + m = (struct mbuf *)slirp->if_batchq.qh_link; + while ((struct quehead *)m != &slirp->if_batchq) { + next = m->m_next; + g_free(m); + m = next; + } + m = (struct mbuf *)slirp->if_fastq.qh_link; + while ((struct quehead *)m != &slirp->if_fastq) { + next = m->m_next; + g_free(m); + m = next; + } } /* |