提交 b41c693e 编写于 作者: S Shuo 提交者: neverchanje

fix(asan): heap-use-after-free in pegasus_write_service.cpp (#478)

上级 01312e75
......@@ -297,16 +297,18 @@ int pegasus_write_service::duplicate(int64_t decree,
resp.__set_error(_impl->multi_remove(ctx.decree, rpc.request(), rpc.response()));
return resp.error;
}
put_rpc put;
remove_rpc remove;
if (request.task_code == dsn::apps::RPC_RRDB_RRDB_PUT ||
request.task_code == dsn::apps::RPC_RRDB_RRDB_REMOVE) {
int err = 0;
if (request.task_code == dsn::apps::RPC_RRDB_RRDB_PUT) {
put_rpc rpc(write);
err = _impl->batch_put(ctx, rpc.request(), rpc.response());
put = put_rpc(write);
err = _impl->batch_put(ctx, put.request(), put.response());
}
if (request.task_code == dsn::apps::RPC_RRDB_RRDB_REMOVE) {
remove_rpc rpc(write);
err = _impl->batch_remove(ctx.decree, rpc.request(), rpc.response());
remove = remove_rpc(write);
err = _impl->batch_remove(ctx.decree, remove.request(), remove.response());
}
if (!err) {
err = _impl->batch_commit(ctx.decree);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册