From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anatoly Burakov Subject: [PATCH v2 2/6] test: fix memory leak in reorder autotest Date: Wed, 17 Jan 2018 08:36:12 +0000 Message-ID: <6925b0661ffc03bee1ebde3ab879fce388b2e7cd.1515845958.git.anatoly.burakov@intel.com> References: Cc: Reshma Pattan , sergio.gonzalez.monroy@intel.com, reshma.pattan@intek.com, stable@dpdk.org To: dev@dpdk.org Return-path: In-Reply-To: In-Reply-To: <9d5a3bc7a779b2dddab4256aa3e0631737861f98.1513867589.git.anatoly.burakov@intel.com> References: <9d5a3bc7a779b2dddab4256aa3e0631737861f98.1513867589.git.anatoly.burakov@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add a teardown function that frees allocated resources. Fixes: d0c9b58d7156 ("app/test: new reorder unit test") Cc: sergio.gonzalez.monroy@intel.com Cc: reshma.pattan@intek.com Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov --- test/test/test_reorder.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test/test_reorder.c b/test/test/test_reorder.c index e834bac..65e4f38 100644 --- a/test/test/test_reorder.c +++ b/test/test/test_reorder.c @@ -331,9 +331,20 @@ test_setup(void) return 0; } +static void +test_teardown(void) +{ + rte_reorder_free(test_params->b); + test_params->b = NULL; + rte_mempool_free(test_params->p); + test_params->p = NULL; +} + + static struct unit_test_suite reorder_test_suite = { .setup = test_setup, + .teardown = test_teardown, .suite_name = "Reorder Unit Test Suite", .unit_test_cases = { TEST_CASE(test_reorder_create), -- 2.7.4