From b08121d00467874ac9aa0dc6f59787877f1bb427 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 23 Dec 2012 11:56:13 +0100 Subject: systemctl: don't show cgroup field for a unit if cgroup is empty --- src/shared/cgroup-show.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/shared/cgroup-show.c') diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c index 437d09711b..2b79f370f9 100644 --- a/src/shared/cgroup-show.c +++ b/src/shared/cgroup-show.c @@ -335,7 +335,7 @@ int show_cgroup_and_extra(const char *controller, const char *path, const char * int show_cgroup_and_extra_by_spec(const char *spec, const char *prefix, unsigned n_columns, bool kernel_threads, bool all, const pid_t extra_pids[], unsigned n_extra_pids) { int r; - char *controller, *path; + _cleanup_free_ char *controller = NULL, *path = NULL; assert(spec); @@ -343,9 +343,5 @@ int show_cgroup_and_extra_by_spec(const char *spec, const char *prefix, unsigned if (r < 0) return r; - r = show_cgroup_and_extra(controller, path, prefix, n_columns, kernel_threads, all, extra_pids, n_extra_pids); - free(controller); - free(path); - - return r; + return show_cgroup_and_extra(controller, path, prefix, n_columns, kernel_threads, all, extra_pids, n_extra_pids); } -- cgit v1.2.3