diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-05-20 07:41:48 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-05-20 14:57:09 +0200 |
commit | eda397c96607eadf5e881d4a4a62d7ea345a655a (patch) | |
tree | 3d7779a2f468415fd23128147fb07795f81ca100 | |
parent | nspawn: use strextendf_with_separator() (diff) | |
download | systemd-eda397c96607eadf5e881d4a4a62d7ea345a655a.tar.xz systemd-eda397c96607eadf5e881d4a4a62d7ea345a655a.zip |
run: use strextend_with_separator()
-rw-r--r-- | src/run/run.c | 11 |
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; |