fix(network): stack-use-after-return found by address sanitizer

Fixes compilation with clang.
This commit is contained in:
Aleksei Bavshin
2019-08-17 18:11:22 -07:00
parent 9d0842db48
commit 8f9e6c132d
2 changed files with 5 additions and 3 deletions

View File

@ -130,7 +130,8 @@ std::tuple<std::string, std::string> Host::getBusNameAndObjectPath(const std::st
}
void Host::addRegisteredItem(std::string service) {
auto [bus_name, object_path] = getBusNameAndObjectPath(service);
std::string bus_name, object_path;
std::tie(bus_name, object_path) = getBusNameAndObjectPath(service);
auto it = std::find_if(items_.begin(), items_.end(), [&bus_name, &object_path](const auto& item) {
return bus_name == item->bus_name && object_path == item->object_path;
});