X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcgroups.c;h=3a59ec4c02e299a7368ac8dd53c8adeda45a7b1e;hb=2761915bed8c6caea41018be3e675aa712cc0b0a;hp=508ba90f144ed5f65b4017361ab19815434ed04d;hpb=063a5e75b36173e89ffa18d32d47509f6ef968ec;p=collectd.git diff --git a/src/cgroups.c b/src/cgroups.c index 508ba90f..3a59ec4c 100644 --- a/src/cgroups.c +++ b/src/cgroups.c @@ -207,18 +207,16 @@ static int cgroups_config (const char *key, const char *value) static int cgroups_read (void) { - cu_mount_t *mnt_list; - cu_mount_t *mnt_ptr; + cu_mount_t *mnt_list = NULL; _Bool cgroup_found = 0; - mnt_list = NULL; if (cu_mount_getlist (&mnt_list) == NULL) { ERROR ("cgroups plugin: cu_mount_getlist failed."); return (-1); } - for (mnt_ptr = mnt_list; mnt_ptr != NULL; mnt_ptr = mnt_ptr->next) + for (cu_mount_t *mnt_ptr = mnt_list; mnt_ptr != NULL; mnt_ptr = mnt_ptr->next) { /* Find the cgroup mountpoint which contains the cpuacct * controller. */