summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXie Changlong <xiechanglong@cmss.chinamobile.com>2020-01-16 10:00:41 +0800
committerAmar Tumballi <amarts@gmail.com>2020-01-20 05:21:33 +0000
commit3043fc54b0bdcf87fce13dcd9c56d0dd30e1c5b2 (patch)
tree26a53b7424fb388f724d46c8a0657234f661cc11
parentc7b546326092d060bf84b7c578a4f21bc679674a (diff)
glusterd: fix use after free
updates: bz#789278 Change-Id: I652d8d4428cf6ce61b712a66d309e78030a5f911 Signed-off-by: Xie Changlong <xiechanglong@cmss.chinamobile.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 6816699..ae9ec5a 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)