Commit f478c331 authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Chromium LUCI CQ

Fix potential use-after-move in //net/base/

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

Bug: 1122844
Change-Id: I7b45782b6f9fed91c68cf3e989be026cadfd9d7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2586344
Commit-Queue: Wez <wez@chromium.org>
Auto-Submit: Maksim Ivanov <emaxx@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836070}
parent 320ccdbf
...@@ -107,13 +107,13 @@ void NetworkChangeNotifierFuchsia::OnInterfacesEvent( ...@@ -107,13 +107,13 @@ void NetworkChangeNotifierFuchsia::OnInterfacesEvent(
void NetworkChangeNotifierFuchsia::OnInterfaceAdded( void NetworkChangeNotifierFuchsia::OnInterfaceAdded(
fuchsia::net::interfaces::Properties properties) { fuchsia::net::interfaces::Properties properties) {
uint64_t id = properties.id();
base::Optional<internal::InterfaceProperties> cache_entry = base::Optional<internal::InterfaceProperties> cache_entry =
internal::InterfaceProperties::VerifyAndCreate(std::move(properties)); internal::InterfaceProperties::VerifyAndCreate(std::move(properties));
if (!cache_entry) { if (!cache_entry) {
OnWatcherError("OnInterfaceAdded: incomplete interface properties."); OnWatcherError("OnInterfaceAdded: incomplete interface properties.");
return; return;
} }
uint64_t id = properties.id();
if (interface_cache_.find(id) != interface_cache_.end()) { if (interface_cache_.find(id) != interface_cache_.end()) {
OnWatcherError(base::StringPrintf( OnWatcherError(base::StringPrintf(
"OnInterfaceAdded: duplicate interface ID %lu.", id)); "OnInterfaceAdded: duplicate interface ID %lu.", id));
......
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