nspawn: fix two failure paths

We need to go to "finish" rather than just return.

All our exit paths got this right, except two.
This commit is contained in:
Lennart Poettering
2023-11-03 09:42:53 +01:00
parent b75b8e1d02
commit 41de458aed

View File

@@ -5659,8 +5659,10 @@ static int run(int argc, char *argv[]) {
if (arg_pivot_root_new) {
b = path_join(arg_directory, arg_pivot_root_new);
if (!b)
return log_oom();
if (!b) {
r = log_oom();
goto finish;
}
p = b;
} else
@@ -5678,8 +5680,10 @@ static int run(int argc, char *argv[]) {
p = path_join(arg_directory, arg_pivot_root_new, "/usr/");
else
p = path_join(arg_directory, "/usr/");
if (!p)
return log_oom();
if (!p) {
r = log_oom();
goto finish;
}
if (laccess(p, F_OK) < 0) {
r = log_error_errno(SYNTHETIC_ERRNO(EINVAL),