summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Puccetti <alessandro@kinvolk.io>2016-06-06 12:38:23 +0200
committerLennart Poettering <lennart@poettering.net>2016-06-06 12:38:23 +0200
commit0738b927a1ec80549e92bc70ded6959b4c6a8c57 (patch)
tree06ffbe963a342d77da0567e227ed9e9e10948b6f
parent308253c5a2b146fc18e3789725c092ac55b10ce7 (diff)
cgtop: fix ret pointer usage (#3443)
-rw-r--r--src/cgtop/cgtop.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index b4a982ce38..6bd2288897 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -868,13 +868,15 @@ 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) {
- *ret = strdup(arg_root);
- if (!*ret)
+ aux = strdup(arg_root);
+ if (!aux)
return log_oom();
+ *ret = aux;
return 0;
}