summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/shared/install.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shared/install.c b/src/shared/install.c
index 5d3fcf5e32..61e572bdf3 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -1025,8 +1025,10 @@ static int config_parse_default_instance(
if (r < 0)
return r;
- if (!unit_instance_is_valid(printed))
+ if (!unit_instance_is_valid(printed)) {
+ free(printed);
return -EINVAL;
+ }
free(i->default_instance);
i->default_instance = printed;