Apply empty_to_root() in three more spots for safety
This commit is contained in:
parent
624e4fcffa
commit
95b21cff0e
|
@ -388,7 +388,7 @@ int cg_kill_recursive(
|
||||||
while ((r = cg_read_subgroup(d, &fn)) > 0) {
|
while ((r = cg_read_subgroup(d, &fn)) > 0) {
|
||||||
_cleanup_free_ char *p = NULL;
|
_cleanup_free_ char *p = NULL;
|
||||||
|
|
||||||
p = path_join(path, fn);
|
p = path_join(empty_to_root(path), fn);
|
||||||
free(fn);
|
free(fn);
|
||||||
if (!p)
|
if (!p)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -522,7 +522,7 @@ int cg_migrate_recursive(
|
||||||
while ((r = cg_read_subgroup(d, &fn)) > 0) {
|
while ((r = cg_read_subgroup(d, &fn)) > 0) {
|
||||||
_cleanup_free_ char *p = NULL;
|
_cleanup_free_ char *p = NULL;
|
||||||
|
|
||||||
p = path_join(pfrom, fn);
|
p = path_join(empty_to_root(pfrom), fn);
|
||||||
free(fn);
|
free(fn);
|
||||||
if (!p)
|
if (!p)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
|
@ -2490,7 +2490,7 @@ static int unit_watch_pids_in_path(Unit *u, const char *path) {
|
||||||
while ((r = cg_read_subgroup(d, &fn)) > 0) {
|
while ((r = cg_read_subgroup(d, &fn)) > 0) {
|
||||||
_cleanup_free_ char *p = NULL;
|
_cleanup_free_ char *p = NULL;
|
||||||
|
|
||||||
p = path_join(path, fn);
|
p = path_join(empty_to_root(path), fn);
|
||||||
free(fn);
|
free(fn);
|
||||||
|
|
||||||
if (!p)
|
if (!p)
|
||||||
|
|
Loading…
Reference in New Issue