Skip to content

Commit ba9c445

Browse files
testwillgopherbot
authored andcommitted
cmd/go: close elf file in the readpkglist function
Change-Id: Ief08e311598152f047878fc0fe6a6e37df372ee9 GitHub-Last-Rev: daec402 GitHub-Pull-Request: #66588 Reviewed-on: https://go-review.googlesource.com/c/go/+/575156 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]>
1 parent 0bf6071 commit ba9c445

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/cmd/go/internal/work/action.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ func readpkglist(shlibpath string) (pkgs []*load.Package) {
384384
if err != nil {
385385
base.Fatal(fmt.Errorf("failed to open shared library: %v", err))
386386
}
387+
defer f.Close()
387388
sect := f.Section(".go_export")
388389
if sect == nil {
389390
base.Fatal(fmt.Errorf("%s: missing .go_export section", shlibpath))

0 commit comments

Comments
 (0)