From: Yu Watanabe Date: Thu, 20 May 2021 05:41:48 +0000 (+0900) Subject: run: use strextend_with_separator() X-Git-Tag: v249-rc1~182^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eda397c96607eadf5e881d4a4a62d7ea345a655a;p=thirdparty%2Fsystemd.git run: use strextend_with_separator() --- diff --git a/src/run/run.c b/src/run/run.c index 555f0584c84..38de0322e0f 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;