From 975c5572a8300c81e127c27e677974f49e96bd5d Mon Sep 17 00:00:00 2001 From: Ryan Ding Date: Wed, 24 Aug 2016 00:08:12 +0800 Subject: features/read-only: reten_mode is invalid to be free by mem_put() priv->reten_mode is initialised by option 'retention-mode'. and it reference the memory in this->options. so fini() use mem_put to free priv->reten_mode will cause a problem. there is no need to call mem_put(), so just remove it will be fine. Change-Id: Iee6f9d1d54df38cba8c9b9100e2824f4f2b18ab4 BUG: 1369523 Signed-off-by: Ryan Ding Reviewed-on: http://review.gluster.org/15296 Smoke: Gluster Build System Reviewed-by: Niels de Vos CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System --- xlators/features/read-only/src/worm.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'xlators/features') diff --git a/xlators/features/read-only/src/worm.c b/xlators/features/read-only/src/worm.c index 5ba6641fca2..eec3b384212 100644 --- a/xlators/features/read-only/src/worm.c +++ b/xlators/features/read-only/src/worm.c @@ -480,13 +480,6 @@ init (xlator_t *this) goto out; } - priv->reten_mode = mem_get0 (this->local_pool); - if (!priv->reten_mode) { - gf_log (this->name, GF_LOG_ERROR, "Error allocating " - "reten_mode"); - goto out; - } - GF_OPTION_INIT ("worm", priv->readonly_or_worm_enabled, bool, out); GF_OPTION_INIT ("worm-file-level", priv->worm_file, bool, out); @@ -536,10 +529,6 @@ fini (xlator_t *this) priv = this->private; if (!priv) goto out; - if (priv->reten_mode != NULL) { - mem_put (priv->reten_mode); - priv->reten_mode = NULL; - } mem_put (priv); this->private = NULL; mem_pool_destroy (this->local_pool); -- cgit