Merge pull request #16238 from keszybz/set-handling-more

Fix handling of cases where a duplicate item is added to a set and related cleanups
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2020-06-24 17:42:13 +02:00
committed by GitHub
46 changed files with 276 additions and 504 deletions
+1 -7
View File
@@ -377,15 +377,9 @@ static int userdb_connect(
if (r < 0)
return log_debug_errno(r, "Failed to invoke varlink method: %m");
r = set_ensure_allocated(&iterator->links, &link_hash_ops);
if (r < 0)
return log_debug_errno(r, "Failed to allocate set: %m");
r = set_put(iterator->links, vl);
r = set_ensure_consume(&iterator->links, &link_hash_ops, TAKE_PTR(vl));
if (r < 0)
return log_debug_errno(r, "Failed to add varlink connection to set: %m");
TAKE_PTR(vl);
return r;
}