summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-shared.c
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2017-10-09 17:56:56 +0200
committerN Balachandran <nbalacha@redhat.com>2017-10-11 03:59:23 +0000
commit6628b9426918010d203a7de19e3e187eeb077b0d (patch)
tree86e20008add9a71cb1bf9459149f05e0c5badbed /xlators/cluster/dht/src/dht-shared.c
parentdc3cd44add80fb56fae2492cb8ad264be04f46fc (diff)
dht: free memory allocated in dht_init() and dht_init_subvolumes()
When glfs_fini() is called, DHT fails to free all memory allocations which result in a considerable leak. Change-Id: I37c6de5c93ca4516266dbe8288b4a416f5589901 BUG: 1443145 Signed-off-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-shared.c')
-rw-r--r--xlators/cluster/dht/src/dht-shared.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-shared.c b/xlators/cluster/dht/src/dht-shared.c
index 42daff01489..38de31d1ec9 100644
--- a/xlators/cluster/dht/src/dht-shared.c
+++ b/xlators/cluster/dht/src/dht-shared.c
@@ -237,9 +237,25 @@ dht_fini (xlator_t *this)
dict_unref(conf->leaf_to_subvol);
+ /* allocated in dht_init_subvolumes() */
GF_FREE (conf->subvolumes);
-
GF_FREE (conf->subvolume_status);
+ GF_FREE (conf->last_event);
+ GF_FREE (conf->subvol_up_time);
+ GF_FREE (conf->du_stats);
+ GF_FREE (conf->decommissioned_bricks);
+
+ /* allocated in dht_init() */
+ GF_FREE (conf->mds_xattr_key);
+ GF_FREE (conf->link_xattr_name);
+ GF_FREE (conf->commithash_xattr_name);
+ GF_FREE (conf->wild_xattr_name);
+
+ /* allocated in dht_init_regex() */
+ if (conf->rsync_regex_valid)
+ regfree (&conf->rsync_regex);
+ if (conf->extra_regex_valid)
+ regfree (&conf->extra_regex);
synclock_destroy (&conf->link_lock);