From 3043fc54b0bdcf87fce13dcd9c56d0dd30e1c5b2 Mon Sep 17 00:00:00 2001 From: Xie Changlong Date: Thu, 16 Jan 2020 10:00:41 +0800 Subject: glusterd: fix use after free updates: bz#789278 Change-Id: I652d8d4428cf6ce61b712a66d309e78030a5f911 Signed-off-by: Xie Changlong --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 68166998b49..ae9ec5ab88e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -5493,6 +5493,7 @@ glusterd_op_ac_stage_op(glusterd_op_sm_event_t *event, void *ctx) gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED, "Failed to set transaction id."); GF_FREE(txn_id); + txn_id = NULL; goto out; } @@ -5511,7 +5512,8 @@ out: * txn_opinfo can't be cleared as that'll lead to a race of referring op_ctx * after it's being freed. */ - if (txn_op_info.skip_locking && priv->op_version >= GD_OP_VERSION_6_0) + if (txn_op_info.skip_locking && priv->op_version >= GD_OP_VERSION_6_0 && + txn_id) ret = glusterd_clear_txn_opinfo(txn_id); if (rsp_dict) -- cgit