From: Lennart Poettering Date: Thu, 9 Jun 2016 08:49:36 +0000 (+0200) Subject: load-fragment: don't try to do a template instance replacement if we are not an insta... X-Git-Tag: v231~197 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9d3e340639bc0b4610f7ece98a84157dbc1c2c8f;p=thirdparty%2Fsystemd.git load-fragment: don't try to do a template instance replacement if we are not an instance (#3451) Corrects: 7aad67e7 Fixes: #3438 --- diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index b53301a147e..2d8f6296c88 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);