summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/run/run.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/run/run.c b/src/run/run.c
index 555f0584c8..38de0322e0 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -667,15 +667,8 @@ static int transient_cgroup_set_properties(sd_bus_message *m) {
*end = 0;
}
- if (!isempty(arg_slice)) {
- if (name) {
- char *j = strjoin(name, "-", arg_slice);
- free_and_replace(name, j);
- } else
- name = strdup(arg_slice);
- if (!name)
- return log_oom();
- }
+ if (!isempty(arg_slice) && !strextend_with_separator(&name, "-", arg_slice))
+ return log_oom();
if (!name)
return 0;