Merge pull request #156 from mrunalp/close_fix

Fix files not closed in mountinfo parsing function
This commit is contained in:
Michael Crosby 2015-07-27 16:45:43 -07:00
commit 732c3e4b4a
1 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,8 @@ func FindCgroupMountpoint(subsystem string) (string, error) {
if err != nil {
return "", err
}
defer f.Close()
scanner := bufio.NewScanner(f)
for scanner.Scan() {
txt := scanner.Text()
@ -47,6 +49,8 @@ func FindCgroupMountpointAndSource(subsystem string) (string, string, error) {
if err != nil {
return "", "", err
}
defer f.Close()
scanner := bufio.NewScanner(f)
for scanner.Scan() {
txt := scanner.Text()