tree-wide: don't use strjoina() on getenv() values

Avoid doing stack allocations on environment variables.
This commit is contained in:
Anita Zhang
2022-01-27 13:45:00 +09:00
committed by Yu Watanabe
parent f223fd6add
commit 1d3b68f6e1
6 changed files with 49 additions and 19 deletions
+6 -2
View File
@@ -238,7 +238,7 @@ static int acquire_generator_dirs(
char **generator_early,
char **generator_late) {
_cleanup_free_ char *x = NULL, *y = NULL, *z = NULL;
_cleanup_free_ char *x = NULL, *y = NULL, *z = NULL, *p = NULL;
const char *prefix;
assert(generator);
@@ -261,7 +261,11 @@ static int acquire_generator_dirs(
if (!e)
return -ENXIO;
prefix = strjoina(e, "/systemd");
p = path_join(e, "/systemd");
if (!p)
return -ENOMEM;
prefix = p;
}
x = path_join(prefix, "generator");