load-fragment: don't try to do a template instance replacement if we are not an instance (#3451)

Corrects: 7aad67e7

Fixes: #3438
This commit is contained in:
Lennart Poettering
2016-06-09 10:49:36 +02:00
committed by Martin Pitt
parent 207c0b0ee3
commit 9d3e340639
+1 -1
View File
@@ -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);