mirror of
https://github.com/arnaucube/go-ethereum.git
synced 2026-02-28 05:56:45 +01:00
metrics: fix file descriptor leak when reading disk stats on linux
The disk stats file was not closed after reading.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user