Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Commit

Permalink
fix small memory leak in df plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
charless-splunk committed Apr 4, 2017
1 parent 790d556 commit d4e4b72
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/df.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,10 @@ static int df_read(void) {
(gauge_t)((float_t)(blk_reserved) / statbuf.f_blocks * 100));
df_submit_one(disk_name, "percent_bytes", "used",
(gauge_t)((float_t)(blk_used) / statbuf.f_blocks * 100));
} else
} else {
cu_mount_freelist(mnt_list);
return (-1);
}
}

/* inode handling */
Expand Down Expand Up @@ -339,8 +341,10 @@ static int df_read(void) {
df_submit_one(
disk_name, "percent_inodes", "used",
(gauge_t)((float_t)(inode_used) / statbuf.f_files * 100));
} else
} else {
cu_mount_freelist(mnt_list);
return (-1);
}
}
if (values_absolute) {
df_submit_one(disk_name, "df_inodes", "free", (gauge_t)inode_free);
Expand Down

0 comments on commit d4e4b72

Please sign in to comment.