Security: Send LinkKey reply without std::move
Bug: 162984360
Test: ./cert/run --host SecurityTest
Change-Id: Ib39682ff4e02af46396d7c133fb7b4faf72f8c16
diff --git a/system/gd/security/pairing/classic_pairing_handler.cc b/system/gd/security/pairing/classic_pairing_handler.cc
index 4e13b6e..7b1578d 100644
--- a/system/gd/security/pairing/classic_pairing_handler.cc
+++ b/system/gd/security/pairing/classic_pairing_handler.cc
@@ -150,16 +150,15 @@
LOG_INFO("Received: %s", hci::EventCodeText(packet.GetEventCode()).c_str());
ASSERT_LOG(GetRecord()->GetPseudoAddress()->GetAddress() == packet.GetBdAddr(), "Address mismatch");
if (GetRecord()->IsPaired()) {
- auto packet = hci::LinkKeyRequestReplyBuilder::Create(
- GetRecord()->GetPseudoAddress()->GetAddress(), GetRecord()->GetLinkKey());
LOG_INFO("Sending: LINK_KEY_REQUEST_REPLY");
- this->GetChannel()->SendCommand(std::move(packet));
+ this->GetChannel()->SendCommand(hci::LinkKeyRequestReplyBuilder::Create(
+ GetRecord()->GetPseudoAddress()->GetAddress(), GetRecord()->GetLinkKey()));
last_status_ = hci::ErrorCode::SUCCESS;
Cancel();
} else {
- auto packet = hci::LinkKeyRequestNegativeReplyBuilder::Create(GetRecord()->GetPseudoAddress()->GetAddress());
LOG_INFO("Sending: LINK_KEY_REQUEST_NEGATIVE_REPLY");
- this->GetChannel()->SendCommand(std::move(packet));
+ this->GetChannel()->SendCommand(
+ hci::LinkKeyRequestNegativeReplyBuilder::Create(GetRecord()->GetPseudoAddress()->GetAddress()));
}
}