summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2015-12-07 13:32:57 +0530
committerDan Lambright <dlambrig@redhat.com>2015-12-07 06:35:59 -0800
commit06818a0fd69bb0d6daabde73e5c3cc2661a70854 (patch)
treed0be4e1635a3e4d2fd43abade6ed5fefff0cc939
parentb1d047caeacbcfac4222759af9d5936b7cfd1d7c (diff)
cluster/tier : Fix double free in tier process
The tier process tries to free ipc_ctr_params twice if the syncop_ipc call in tier_process_ctr_query fails. ipc_ctr_params is freed when ctr_ipc_in_dict is freed. But ctr_ipc_out_dict is NULL when syncop_ipc fails, causing GF_FREE to be called on a non-NULL ipc_ctr_params ptr again. Change-Id: Ia15f36dfbcd97be5524588beb7caad5cb79efdb4 BUG: 1288995 Signed-off-by: N Balachandran <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/12890 Reviewed-by: Joseph Fernandes Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
-rw-r--r--xlators/cluster/dht/src/tier.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c
index 32bec8849b5..450f8e070fd 100644
--- a/xlators/cluster/dht/src/tier.c
+++ b/xlators/cluster/dht/src/tier.c
@@ -842,6 +842,7 @@ tier_process_ctr_query (tier_brick_list_t *local_brick, void *args)
gf_msg (this->name, GF_LOG_ERROR, 0, LG_MSG_SET_PARAM_FAILED,
"Failed setting %s to params dictionary",
GFDB_IPC_CTR_GET_QUERY_PARAMS);
+ GF_FREE (ipc_ctr_params);
goto out;
}
@@ -887,11 +888,8 @@ out:
if (ctr_ipc_out_dict) {
dict_unref(ctr_ipc_out_dict);
ctr_ipc_out_dict = NULL;
- ipc_ctr_params = NULL;
}
- GF_FREE (ipc_ctr_params);
-
return ret;
}