Commit 720f6252 authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Commit Bot

Fix double-callback-call crashes in //device/bluetooth/dbus/

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

Bug: 1122844
Change-Id: If63e908641ccf616d9f1d31c0ec39298fe32302e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2385277
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Reviewed-by: default avatarMiao-chen Chou <mcchou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804192}
parent 168b1918
...@@ -639,6 +639,7 @@ class BluetoothDeviceClientImpl : public BluetoothDeviceClient, ...@@ -639,6 +639,7 @@ class BluetoothDeviceClientImpl : public BluetoothDeviceClient,
dbus::MessageReader reader(response); dbus::MessageReader reader(response);
if (!ReadRecordsFromMessage(&reader, &records)) { if (!ReadRecordsFromMessage(&reader, &records)) {
std::move(callback).Run(ServiceRecordList()); std::move(callback).Run(ServiceRecordList());
return;
} }
std::move(callback).Run(records); std::move(callback).Run(records);
......
...@@ -172,6 +172,7 @@ class BluetoothAdvertisementServiceProviderImpl ...@@ -172,6 +172,7 @@ class BluetoothAdvertisementServiceProviderImpl
method_call, kErrorInvalidArgs, method_call, kErrorInvalidArgs,
"No such property: '" + property_name + "'."); "No such property: '" + property_name + "'.");
std::move(response_sender).Run(std::move(error_response)); std::move(response_sender).Run(std::move(error_response));
return;
} }
writer.CloseContainer(&variant_writer); writer.CloseContainer(&variant_writer);
......
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