diff options
author | Felix Lange <fjl@twurst.com> | 2015-08-03 08:42:45 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-08-03 22:27:36 +0800 |
commit | bf48ed32dd8be6bec2931c9f1eee4fd749affa21 (patch) | |
tree | c38b682e01a4c548990c9439ac08fd4c6bfd5acc /metrics/disk_linux.go | |
parent | ba14957cf3ce8415bd930310a0edd1fce76ddb22 (diff) | |
download | dexon-bf48ed32dd8be6bec2931c9f1eee4fd749affa21.tar dexon-bf48ed32dd8be6bec2931c9f1eee4fd749affa21.tar.gz dexon-bf48ed32dd8be6bec2931c9f1eee4fd749affa21.tar.bz2 dexon-bf48ed32dd8be6bec2931c9f1eee4fd749affa21.tar.lz dexon-bf48ed32dd8be6bec2931c9f1eee4fd749affa21.tar.xz dexon-bf48ed32dd8be6bec2931c9f1eee4fd749affa21.tar.zst dexon-bf48ed32dd8be6bec2931c9f1eee4fd749affa21.zip |
metrics: fix file descriptor leak when reading disk stats on linux
The disk stats file was not closed after reading.
Diffstat (limited to 'metrics/disk_linux.go')
-rw-r--r-- | metrics/disk_linux.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/metrics/disk_linux.go b/metrics/disk_linux.go index e0c8a1a3a..8967d490e 100644 --- a/metrics/disk_linux.go +++ b/metrics/disk_linux.go @@ -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 |