Skip to content

Commit daec402

Browse files
committed
cmd/go: close elf file in the readpkglist function
Signed-off-by: guoguangwu <[email protected]>
1 parent bb523c9 commit daec402

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)