metrics: fix file descriptor leak when reading disk stats on linux

The disk stats file was not closed after reading.
pull/1574/head
Felix Lange 9 years ago
parent ba14957cf3
commit bf48ed32dd
  1. 1
      metrics/disk_linux.go

@ -34,6 +34,7 @@ func ReadDiskStats(stats *DiskStats) error {
if err != nil { if err != nil {
return err return err
} }
defer inf.Close()
in := bufio.NewReader(inf) in := bufio.NewReader(inf)
// Iterate over the IO counter, and extract what we need // Iterate over the IO counter, and extract what we need

Loading…
Cancel
Save