fixup fd leakage in libtcmu_config.c
@@ -371,13 +371,12 @@ int tcmu_load_config(struct tcmu_config *cfg, const char *path)
}
len = tcmu_read_config(fd, buf, TCMU_MAX_CFG_FILE_SIZE);
+ close(fd);
if (len < 0) {
tcmu_err("Failed to read file '%s'\n", path);
return -1;
}
- close(fd);
-
buf[len] = '\0';
tcmu_parse_options(cfg, buf, len);
