diff options
author | Niels de Vos <ndevos@redhat.com> | 2019-05-03 09:18:31 +0200 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2019-05-06 09:50:18 +0000 |
commit | b2d7644435b92bd2468bbaaef7451a64e08c08bd (patch) | |
tree | cecfcbeb1b04d3885ead85b4be800a4572aa0550 /xlators | |
parent | 920a9fe5cb5769470d31f5676ccb55dcdbd3a939 (diff) |
glusterd: prevent use-after-free in glusterd_op_ac_send_brick_op()
Coverity reported that GF_FREE(req_ctx) could be called 2x on req_ctx.
Change-Id: I9120686e5920de8c27688e10de0db6aa26292064
CID: 1401115
Updates: bz#789278
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 460fc476707..bee19e821fd 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -7529,7 +7529,6 @@ glusterd_op_ac_send_brick_op(glusterd_op_sm_event_t *event, void *ctx) if (op_errstr == NULL) gf_asprintf(&op_errstr, OPERRSTR_BUILD_PAYLOAD); opinfo.op_errstr = op_errstr; - GF_FREE(req_ctx); goto out; } } @@ -7548,7 +7547,7 @@ glusterd_op_ac_send_brick_op(glusterd_op_sm_event_t *event, void *ctx) } out: - if (ret && req_ctx && free_req_ctx) + if (ret && free_req_ctx) GF_FREE(req_ctx); gf_msg_debug(this->name, 0, "Returning with %d", ret); |