[v3,3/4] test/hash: free allocated memory

Message ID 20190702002724.41400-3-honnappa.nagarahalli@arm.com
State New
Headers show
Series
  • [v3,1/4] test/hash: reset global variable to discard old data
Related show

Commit Message

Honnappa Nagarahalli July 2, 2019, 12:27 a.m.
Free allocated memory.

Fixes: 3f9aab961ed3 ("test/hash: check lock-free extendable bucket")
Cc: stable@dpdk.org

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>

---
v3
  - removed freeing pos (addressed in 4/4)

v2
  - freed more memory

 app/test/test_hash_readwrite_lf.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-- 
2.17.1

Patch

diff --git a/app/test/test_hash_readwrite_lf.c b/app/test/test_hash_readwrite_lf.c
index 12522e265..792244fd0 100644
--- a/app/test/test_hash_readwrite_lf.c
+++ b/app/test/test_hash_readwrite_lf.c
@@ -537,6 +537,7 @@  generate_keys(void)
 	       tbl_rwc_test_param.count_keys_ks_extbkt);
 
 	rte_free(found);
+	rte_free(scanned_bkts);
 	rte_hash_free(tbl_rwc_test_param.h);
 	return 0;
 
@@ -547,9 +548,11 @@  generate_keys(void)
 	rte_free(keys_absent);
 	rte_free(found);
 	rte_free(tbl_rwc_test_param.keys_shift_path);
+	rte_free(keys_non_shift_path);
 	rte_free(keys_ext_bkt);
 	rte_free(keys_ks_extbkt);
 	rte_free(scanned_bkts);
+	rte_hash_free(tbl_rwc_test_param.h);
 	return -1;
 }
 
@@ -1431,7 +1434,9 @@  test_hash_readwrite_lf_main(void)
 	rte_free(tbl_rwc_test_param.keys_ks);
 	rte_free(tbl_rwc_test_param.keys_absent);
 	rte_free(tbl_rwc_test_param.keys_shift_path);
-	rte_free(scanned_bkts);
+	rte_free(tbl_rwc_test_param.keys_non_shift_path);
+	rte_free(tbl_rwc_test_param.keys_ext_bkt);
+	rte_free(tbl_rwc_test_param.keys_ks_extbkt);
 	return 0;
 }