test/mbuf: fix access to freed memory tmp_20211029
authorOlivier Matz <olivier.matz@6wind.com>
Fri, 29 Oct 2021 11:47:37 +0000 (13:47 +0200)
committerOlivier Matz <olivier.matz@6wind.com>
Fri, 29 Oct 2021 11:52:23 +0000 (13:52 +0200)
commit7c9fc7bc883107eaa5842792450a565db6b6ee99
tree531fe24916f0fc1d1606590d8b42abc745177611
parent1c9ce175d6e781dd1e1dcb900b72495b92283c36
test/mbuf: fix access to freed memory

Seen by ASan.

In the external buffer mbuf test, we check that the buffer is freed
by checking that its refcount is 0. This is not a valid condition,
because it accesses to an already freed area.

Fix this by setting a boolean flag in the callback when rte_free()
is actually called, and check this flag instead.

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
app/test/test_mbuf.c