From 230eaff9cf0f955a0ae49dc3c372ae3e960b732f Mon Sep 17 00:00:00 2001 From: Tw Date: Tue, 13 Jan 2015 16:46:26 +0800 Subject: [PATCH] cmd/benchcmp: close file when parse done prevent file descriptor leak Signed-off-by: Tw Change-Id: Ia1cacb3a287477b1f9b50fae248b5c34156c9557 Reviewed-on: https://go-review.googlesource.com/2740 Reviewed-by: Rob Pike --- cmd/benchcmp/benchcmp.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/benchcmp/benchcmp.go b/cmd/benchcmp/benchcmp.go index e32c9c3c..5d87561c 100644 --- a/cmd/benchcmp/benchcmp.go +++ b/cmd/benchcmp/benchcmp.go @@ -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)