From a3d42fe5b141ce03417f555a0387ff38602d6373 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 3e78731..d7d107f 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -1799,6 +1799,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