@cryptotaxi247 / netdata-1 / commits / 0b749a7db

Fix a coverity defect (#9462)

Vladimir Kobal committed Jul 2, 2020 at 13:23 UTC 0b749a7dbeaddd588147ff3f2152c6fee528c311
1 file changed +2 -1
collectors/cgroups.plugin/sys_fs_cgroup.c
+2 -1
@@ -184,6 +184,7 @@ static enum cgroups_type cgroups_try_detect_version()
184
185 if (!fgets(buf, MAXSIZE_PROC_CMDLINE, f)) {
186 error("couldn't read all cmdline params into buffer");
187 + fclose(f);
188 return CGROUPS_AUTODETECT_FAIL;
189 }
190
@@ -213,7 +214,7 @@ void read_cgroup_plugin_configuration() {
214 cgroup_check_for_new_every = cgroup_update_every;
215
216 cgroup_use_unified_cgroups = config_get_boolean_ondemand("plugin:cgroups", "use unified cgroups", CONFIG_BOOLEAN_AUTO);
216 - if(cgroup_use_unified_cgroups == CONFIG_BOOLEAN_AUTO)
217 + if(cgroup_use_unified_cgroups == CONFIG_BOOLEAN_AUTO)
218 cgroup_use_unified_cgroups = (cgroups_try_detect_version() == CGROUPS_V2);
219
220 info("use unified cgroups %s", cgroup_use_unified_cgroups ? "true" : "false");