fix segv on error

This commit is contained in:
Simon Fraser 2015-08-20 09:40:32 +01:00 committed by Cameron Sparr
parent 4b0671205d
commit 601b444a60
2 changed files with 2 additions and 2 deletions

View File

@ -8,6 +8,7 @@
### Bugfixes
[#113](https://github.com/influxdb/telegraf/issues/113): Update README with Telegraf/InfluxDB compatibility
[#118](https://github.com/influxdb/telegraf/pull/118): Fix for disk usage stats in Windows. Thanks @srfraser!
[#122](https://github.com/influxdb/telegraf/issues/122): Fix for DiskUsage segv fault. Thanks @srfraser!
## v0.1.5 [2015-08-13]

View File

@ -78,11 +78,10 @@ func (s *systemPS) DiskUsage() ([]*disk.DiskUsageStat, error) {
for _, p := range parts {
du, err := disk.DiskUsage(p.Mountpoint)
du.Fstype = p.Fstype
if err != nil {
return nil, err
}
du.Fstype = p.Fstype
usage = append(usage, du)
}