Commit 274fde9a authored by Ian Lance Taylor's avatar Ian Lance Taylor

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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 4b0c8b01
...@@ -30,6 +30,7 @@ func ReadELFNote(filename, name string, typ int32) ([]byte, error) { ...@@ -30,6 +30,7 @@ func ReadELFNote(filename, name string, typ int32) ([]byte, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer f.Close()
for _, sect := range f.Sections { for _, sect := range f.Sections {
if sect.Type != elf.SHT_NOTE { if sect.Type != elf.SHT_NOTE {
continue continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment