提交 bf48ed32 编写于 作者: F Felix Lange

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

The disk stats file was not closed after reading.
上级 ba14957c
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册