1
1
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:
Susant Sahani 2021-01-17 09:55:00 +01:00
parent 53dba3ef07
commit f85f5f0dc8

View File

@ -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);
}