]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: close elf file in the readpkglist function
authorguoguangwu <guoguangwug@gmail.com>
Fri, 29 Mar 2024 06:21:14 +0000 (06:21 +0000)
committerGopher Robot <gobot@golang.org>
Sat, 30 Mar 2024 00:20:35 +0000 (00:20 +0000)
Change-Id: Ief08e311598152f047878fc0fe6a6e37df372ee9
GitHub-Last-Rev: daec402b390e8d1b9882e3fc7c1814ff8d3782c8
GitHub-Pull-Request: golang/go#66588
Reviewed-on: https://go-review.googlesource.com/c/go/+/575156
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

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

index a59072e591d3549277abad2fc4e73b4e87f71aac..723dc2b12742d1a90d3f7f494e725f070e13e946 100644 (file)
@@ -384,6 +384,7 @@ func readpkglist(shlibpath string) (pkgs []*load.Package) {
                if err != nil {
                        base.Fatal(fmt.Errorf("failed to open shared library: %v", err))
                }
+               defer f.Close()
                sect := f.Section(".go_export")
                if sect == nil {
                        base.Fatal(fmt.Errorf("%s: missing .go_export section", shlibpath))