Skip to content

Commit

Permalink
metrics: fix file descriptor leak when reading disk stats on linux
Browse files Browse the repository at this point in the history
The disk stats file was not closed after reading.
  • Loading branch information
fjl committed Aug 3, 2015
1 parent ba14957 commit bf48ed3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions metrics/disk_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func ReadDiskStats(stats *DiskStats) error {
if err != nil {
return err
}
defer inf.Close()
in := bufio.NewReader(inf)

// Iterate over the IO counter, and extract what we need
Expand Down

0 comments on commit bf48ed3

Please sign in to comment.