mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-26 10:03:40 +03:00
core: load fragment - use hashmap_ensure_put
This commit is contained in:
parent
53dba3ef07
commit
f85f5f0dc8
@ -4536,14 +4536,12 @@ int config_parse_set_credential(
|
||||
sc->data = TAKE_PTR(unescaped);
|
||||
sc->size = l;
|
||||
|
||||
r = hashmap_ensure_allocated(&context->set_credentials, &exec_set_credential_hash_ops);
|
||||
r = hashmap_ensure_put(&context->set_credentials, &exec_set_credential_hash_ops, sc->id, sc);
|
||||
if (r == -ENOMEM)
|
||||
return log_oom();
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = hashmap_put(context->set_credentials, sc->id, sc);
|
||||
if (r < 0)
|
||||
return log_oom();
|
||||
|
||||
TAKE_PTR(sc);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user