summaryrefslogtreecommitdiff
path: root/src/run
diff options
context:
space:
mode:
Diffstat (limited to 'src/run')
-rw-r--r--src/run/run.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/run/run.c b/src/run/run.c
index 9d5527b29c..b9be1455c4 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -335,11 +335,11 @@ static int start_transient_service(
_cleanup_free_ char *name = NULL;
int r;
- if (arg_unit)
+ if (arg_unit) {
name = unit_name_mangle_with_suffix(arg_unit, MANGLE_NOGLOB, ".service");
- else
- asprintf(&name, "run-"PID_FMT".service", getpid());
- if (!name)
+ if (!name)
+ return log_oom();
+ } else if (asprintf(&name, "run-"PID_FMT".service", getpid()) < 0)
return log_oom();
r = message_start_transient_unit_new(bus, name, &m);
@@ -471,11 +471,11 @@ static int start_transient_scope(
assert(bus);
- if (arg_unit)
+ if (arg_unit) {
name = unit_name_mangle_with_suffix(arg_unit, MANGLE_NOGLOB, ".scope");
- else
- asprintf(&name, "run-"PID_FMT".scope", getpid());
- if (!name)
+ if (!name)
+ return log_oom();
+ } else if (asprintf(&name, "run-"PID_FMT".scope", getpid()) < 0)
return log_oom();
r = message_start_transient_unit_new(bus, name, &m);