Skip to content

Commit

Permalink
test/reorder: fix double free of drained buffers
Browse files Browse the repository at this point in the history
[ upstream commit d51955ea93fba1873e9c2b86a911e114787bdd4d ]

Set to zero array of drained buffers after free, to prevent freeing them
one more time.
Discovered with enabled `RTE_LIBRTE_MEMPOOL_DEBUG`.

Fixes: ecd867f ("test/reorder: fix freeing mbuf twice")

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
  • Loading branch information
f0rget-the-sad authored and kevintraynor committed Feb 22, 2023
1 parent 68bf4f3 commit fa627c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/test/test_reorder.c
Expand Up @@ -270,6 +270,7 @@ test_reorder_drain(void)
}
if (robufs[0] != NULL)
rte_pktmbuf_free(robufs[0]);
memset(robufs, 0, sizeof(robufs));

/* Insert more packets
* RB[] = {NULL, NULL, NULL, NULL}
Expand Down Expand Up @@ -306,6 +307,7 @@ test_reorder_drain(void)
if (robufs[i] != NULL)
rte_pktmbuf_free(robufs[i]);
}
memset(robufs, 0, sizeof(robufs));

/*
* RB[] = {NULL, NULL, NULL, NULL}
Expand Down

0 comments on commit fa627c9

Please sign in to comment.