summaryrefslogtreecommitdiff
path: root/src/cgtop/cgtop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgtop/cgtop.c')
-rw-r--r--src/cgtop/cgtop.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index b4a982ce38..c67b328b38 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -872,9 +872,13 @@ static int get_cgroup_root(char **ret) {
int r;
if (arg_root) {
- *ret = strdup(arg_root);
- if (!*ret)
+ char *aux;
+
+ aux = strdup(arg_root);
+ if (!aux)
return log_oom();
+
+ *ret = aux;
return 0;
}