Commit 81aa3085 authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Commit Bot

Fix use-after-move in //mojo/core/node_controller.cc

Fix use-after-move (potential) bugs found by the
"bugprone-use-after-move" clang-tidy check.

Bug: 1122844
Change-Id: I0940e75ccf4aaa92b856ccf13e2d6ec5e52a4e77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2385439Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803199}
parent be53a159
......@@ -446,6 +446,7 @@ void NodeController::AcceptBrokerClientInvitationOnIOThread(
inviter_name_ = ports::kInvalidNodeName;
}
const bool leak_endpoint = connection_params.leak_endpoint();
// At this point we don't know the inviter's name, so we can't yet insert it
// into our |peers_| map. That will happen as soon as we receive an
// AcceptInvitee message from them.
......@@ -454,7 +455,7 @@ void NodeController::AcceptBrokerClientInvitationOnIOThread(
Channel::HandlePolicy::kAcceptHandles,
io_task_runner_, ProcessErrorCallback());
if (connection_params.leak_endpoint()) {
if (leak_endpoint) {
// Prevent the inviter pipe handle from being closed on shutdown. Pipe
// closure may be used by the inviter to detect that the invited process
// has terminated. In such cases, the invited process must not be invited
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment