From 96bd49dfcb6476da907cf7ebd9e245014879e9f2 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 22 Jun 2016 15:50:21 -0400 Subject: [PATCH] Fix: memory leak on hash table destroy There is a missing call to pthread_mutex_destroy(3) to match pthread_mutex_init(3) in the hash table creation. Signed-off-by: Mathieu Desnoyers --- rculfhash.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rculfhash.c b/rculfhash.c index 2e90d4d..242a467 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -1806,6 +1806,9 @@ int cds_lfht_destroy(struct cds_lfht *ht, pthread_attr_t **attr) free_split_items_count(ht); if (attr) *attr = ht->resize_attr; + ret = pthread_mutex_destroy(&ht->resize_mutex); + if (ret) + ret = -EBUSY; poison_free(ht); end: return ret; -- 2.34.1