summaryrefslogtreecommitdiff
path: root/src/load-fragment.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/load-fragment.c')
-rw-r--r--src/load-fragment.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/load-fragment.c b/src/load-fragment.c
index 56eaed9ab4..352db6b385 100644
--- a/src/load-fragment.c
+++ b/src/load-fragment.c
@@ -1661,13 +1661,16 @@ static int open_follow(char **filename, FILE **_f, Set *names, char **_final) {
* unit name. */
name = file_name_from_path(*filename);
- if (unit_name_is_valid(name, false)) {
- if (!(id = set_get(names, name))) {
+ if (unit_name_is_valid(name, true)) {
- if (!(id = strdup(name)))
+ id = set_get(names, name);
+ if (!id) {
+ id = strdup(name);
+ if (!id)
return -ENOMEM;
- if ((r = set_put(names, id)) < 0) {
+ r = set_put(names, id);
+ if (r < 0) {
free(id);
return r;
}