1
0
mirror of https://github.com/golang/go synced 2024-11-07 11:56:17 -07:00

cmd/internal/buildid: close ELF file after reading note

Updates #26400

Change-Id: I1747d1f1018521cdfa4b3ed13412a944829967cf
Reviewed-on: https://go-review.googlesource.com/124235
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Ian Lance Taylor 2018-07-16 16:17:27 -07:00
parent 4b0c8b0136
commit 274fde9a36

View File

@ -30,6 +30,7 @@ func ReadELFNote(filename, name string, typ int32) ([]byte, error) {
if err != nil {
return nil, err
}
defer f.Close()
for _, sect := range f.Sections {
if sect.Type != elf.SHT_NOTE {
continue