app/pdump: free mempool at cleanup resources
Checks
Commit Message
the mempool should be free when cleanup resources.
Signed-off-by: Tianli Lai <laitianli@tom.com>
---
app/pdump/main.c | 4 ++++
1 file changed, 4 insertions(+)
Comments
On Thu, 24 Feb 2022 20:14:58 +0800
Tianli Lai <laitianli@tom.com> wrote:
> + if (pt->mp) {
> + rte_mempool_free(pt->mp);
> + pt->mp = NULL;
Check for null is unnecessary here, rte_mempool_free(NULL) is nop.
@@ -510,6 +510,10 @@ struct parse_val {
rte_ring_free(pt->rx_ring);
if (pt->tx_ring)
rte_ring_free(pt->tx_ring);
+ if (pt->mp) {
+ rte_mempool_free(pt->mp);
+ pt->mp = NULL;
+ }
}
}