summaryrefslogtreecommitdiffstats
path: root/src/cgtop
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-06-06 22:04:33 +0200
committerLennart Poettering <lennart@poettering.net>2016-06-06 22:04:33 +0200
commitbdc49d4491da97f7821c34740bcfd26d472085a0 (patch)
treebb21ab2b3a1394b3fa467535e43474660c7e0092 /src/cgtop
parentcore: add minor comment (diff)
downloadsystemd-bdc49d4491da97f7821c34740bcfd26d472085a0.tar.xz
systemd-bdc49d4491da97f7821c34740bcfd26d472085a0.zip
cgtop: minimize aux variable scope
Diffstat (limited to 'src/cgtop')
-rw-r--r--src/cgtop/cgtop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index 6bd2288897..c67b328b38 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -868,14 +868,16 @@ static int get_cgroup_root(char **ret) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
_cleanup_free_ char *unit = NULL, *path = NULL;
- char *aux;
const char *m;
int r;
if (arg_root) {
+ char *aux;
+
aux = strdup(arg_root);
if (!aux)
return log_oom();
+
*ret = aux;
return 0;
}