cmd/benchcmp: close file when parse done

prevent file descriptor leak

Signed-off-by: Tw <tw19881113@gmail.com>

Change-Id: Ia1cacb3a287477b1f9b50fae248b5c34156c9557
Reviewed-on: https://go-review.googlesource.com/2740
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
Tw 2015-01-13 16:46:26 +08:00 committed by Rob Pike
parent 996ff9bec3
commit 230eaff9cf
1 changed files with 1 additions and 0 deletions

View File

@ -142,6 +142,7 @@ func parseFile(path string) parse.BenchSet {
if err != nil {
fatal(err)
}
defer f.Close()
bb, err := parse.ParseBenchSet(f)
if err != nil {
fatal(err)