summaryrefslogtreecommitdiff
path: root/src/core/load-fragment.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-06-09 10:49:36 +0200
committerMartin Pitt <martin.pitt@ubuntu.com>2016-06-09 10:49:36 +0200
commit9d3e340639bc0b4610f7ece98a84157dbc1c2c8f (patch)
treeea8d0d5526cb8ad17f4e452d380fa29d8c69fe1c /src/core/load-fragment.c
parent207c0b0ee30f32ef6ddcb60f67d7a27d73bf4a18 (diff)
load-fragment: don't try to do a template instance replacement if we are not an instance (#3451)
Corrects: 7aad67e7 Fixes: #3438
Diffstat (limited to 'src/core/load-fragment.c')
-rw-r--r--src/core/load-fragment.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index b53301a147..2d8f6296c8 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -3743,7 +3743,7 @@ static int merge_by_names(Unit **u, Set *names, const char *id) {
/* If the symlink name we are looking at is unit template, then
we must search for instance of this template */
- if (unit_name_is_valid(k, UNIT_NAME_TEMPLATE)) {
+ if (unit_name_is_valid(k, UNIT_NAME_TEMPLATE) && (*u)->instance) {
_cleanup_free_ char *instance = NULL;
r = unit_name_replace_instance(k, (*u)->instance, &instance);