commit | 41b92e2731933a820658fc6e9a69732bf30e6635 | [log] [tgz] |
---|---|---|
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | Wed Apr 24 02:39:25 2024 +0200 |
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | Wed Apr 24 02:39:40 2024 +0200 |
tree | bbd0c7f661f8c75d448de823631ca65104f47a55 | |
parent | c195d025b031f458acb2e603395afd49b19f0a2a [diff] |
mbuf: Be extra careful with freed pointer As coverity reports, we are not supposed to do anything with a freed pointer, not even assigning it to m. So break the loop before doing so.
diff --git a/src/mbuf.c b/src/mbuf.c index edcd99c..70c39be 100644 --- a/src/mbuf.c +++ b/src/mbuf.c
@@ -39,7 +39,7 @@ next = m->m_next; last = false; - do { + while (1) { next2 = m->m_nextpkt; if (pkts) { @@ -54,8 +54,11 @@ } g_free(m); + + if (last) + break; m = next2; - } while (!last); + }; m = next; }