core: load fragment - use hashmap_ensure_put
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user