summaryrefslogtreecommitdiff
path: root/src/cgls/cgls.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgls/cgls.c')
-rw-r--r--src/cgls/cgls.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/cgls/cgls.c b/src/cgls/cgls.c
index b2cd968e46..ad59c0127f 100644
--- a/src/cgls/cgls.c
+++ b/src/cgls/cgls.c
@@ -138,7 +138,7 @@ int main(int argc, char *argv[]) {
}
} else {
- char *p;
+ char _cleanup_free_ *p;
p = get_current_dir_name();
if (!p) {
@@ -150,7 +150,7 @@ int main(int argc, char *argv[]) {
printf("Working Directory %s:\n", p);
r = show_cgroup_by_path(p, NULL, 0, arg_kernel_threads, arg_all);
} else {
- char *root = NULL;
+ char _cleanup_free_ *root = NULL;
const char *t = NULL;
r = cg_get_by_pid(SYSTEMD_CGROUP_CONTROLLER, 1, &root);
@@ -164,10 +164,7 @@ int main(int argc, char *argv[]) {
}
r = show_cgroup(SYSTEMD_CGROUP_CONTROLLER, t, NULL, 0, arg_kernel_threads, arg_all);
- free(root);
}
-
- free(p);
}
if (r < 0)