summaryrefslogtreecommitdiffstats
path: root/collectors/proc.plugin
diff options
context:
space:
mode:
authorVladimir Kobal <vlad@prokk.net>2019-02-21 11:22:58 +0200
committerCosta Tsaousis <costa@tsaousis.gr>2019-02-21 11:22:58 +0200
commit72b9b47403c67f1ef396b8ebced04daa8c5e8f40 (patch)
tree4a473057eeeb875df9697a8cb7992b619c6c0768 /collectors/proc.plugin
parent76c4236233d1cd1bdbe8ec2d3eaf066eb779e971 (diff)
Fix Coverity defects (#5394)
* Fix Checked Return issue * Fix Unintended Integer Division issue
Diffstat (limited to 'collectors/proc.plugin')
-rw-r--r--collectors/proc.plugin/sys_fs_btrfs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/collectors/proc.plugin/sys_fs_btrfs.c b/collectors/proc.plugin/sys_fs_btrfs.c
index 5aab24c1a8..cb25ad440d 100644
--- a/collectors/proc.plugin/sys_fs_btrfs.c
+++ b/collectors/proc.plugin/sys_fs_btrfs.c
@@ -308,7 +308,11 @@ static inline int find_all_btrfs_pools(const char *path) {
char label[FILENAME_MAX + 1] = "";
snprintfz(filename, FILENAME_MAX, "%s/%s/label", path, de->d_name);
- read_file(filename, label, FILENAME_MAX);
+ if(read_file(filename, label, FILENAME_MAX) != 0) {
+ error("BTRFS: failed to read '%s'", filename);
+ btrfs_free_node(node);
+ continue;
+ }
char *s = label;
if (s[0])