summaryrefslogtreecommitdiff
path: root/src/run
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-05-20 14:41:48 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-05-20 21:57:09 +0900
commiteda397c96607eadf5e881d4a4a62d7ea345a655a (patch)
tree3d7779a2f468415fd23128147fb07795f81ca100 /src/run
parentcfea7618f28562c053a1ee194108feaa502081ff (diff)
downloadsystemd-eda397c96607eadf5e881d4a4a62d7ea345a655a.tar.gz
run: use strextend_with_separator()
Diffstat (limited to 'src/run')
-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;