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

Fix double-callback-call crash in //c/credential_provider/gaiacp/

Fix bug found by the "bugprone-use-after-move" clang-tidy check.

Bug: 1122844
Change-Id: I6fb3b2d9f0fcaa7fae7ac8e6ef89dc37196455a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2560582Reviewed-by: default avatarRakesh Soma <rakeshsoma@google.com>
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840263}
parent 63238cb3
......@@ -136,8 +136,10 @@ void CredentialProviderBrokerWin::OpenDevice(
// Only if the input device path is corresponding to a FIDO
// device, we will return appropriate device handle. Otherwise,
// return an invalid device handle.
if (usage_page && usage_page.value() == FIDO_USAGE_PAGE)
if (usage_page && usage_page.value() == FIDO_USAGE_PAGE) {
std::move(callback).Run(PlatformHandle(std::move(device_handle)));
return;
}
break;
}
}
......@@ -145,6 +147,5 @@ void CredentialProviderBrokerWin::OpenDevice(
// Return default PlatformHandle when we can't find any appropriate device
// handle.
std::move(callback).Run(PlatformHandle());
return;
}
} // namespace credential_provider
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