hash: fix memory leak of hash_rcu_cfg

Message ID 20221104073358.421827-1-jun.qiu@jaguarmicro.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series hash: fix memory leak of hash_rcu_cfg |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/github-robot: build fail github build: failed
ci/iol-intel-Performance success Performance Testing PASS

Commit Message

Jun Qiu Nov. 4, 2022, 7:33 a.m. UTC
  The memory of h->hash_rcu_cfg which allocated in
rte_hash_rcu_qsbr_add was leaked.

Signed-off-by: Jun Qiu <jun.qiu@jaguarmicro.com>
---
 lib/hash/rte_cuckoo_hash.c | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c
index 62c762439a..829b79c89a 100644
--- a/lib/hash/rte_cuckoo_hash.c
+++ b/lib/hash/rte_cuckoo_hash.c
@@ -521,6 +521,7 @@  rte_hash_free(struct rte_hash *h)
 	rte_free(h->buckets_ext);
 	rte_free(h->tbl_chng_cnt);
 	rte_free(h->ext_bkt_to_free);
+	rte_free(h->hash_rcu_cfg);
 	rte_free(h);
 	rte_free(te);
 }