]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: dbus - use hashmap_ensure_put
authorSusant Sahani <ssahani@vmware.com>
Sun, 17 Jan 2021 08:49:14 +0000 (09:49 +0100)
committerSusant Sahani <ssahani@vmware.com>
Sun, 17 Jan 2021 08:49:14 +0000 (09:49 +0100)
src/core/dbus-execute.c

index 4ad9181993966eff187cc2c821476c6a6c8de4b7..20403df8190877ce279ed7f7569252338321763d 100644 (file)
@@ -1983,11 +1983,7 @@ int bus_exec_context_set_transient_property(
                                         sc->data = TAKE_PTR(copy);
                                         sc->size = sz;
 
-                                        r = hashmap_ensure_allocated(&c->set_credentials, &exec_set_credential_hash_ops);
-                                        if (r < 0)
-                                                return r;
-
-                                        r = hashmap_put(c->set_credentials, sc->id, sc);
+                                        r = hashmap_ensure_put(&c->set_credentials, &exec_set_credential_hash_ops, sc->id, sc);
                                         if (r < 0)
                                                 return r;