mirror of
https://github.com/golang/go
synced 2024-11-07 14:56:16 -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:
parent
4b0c8b0136
commit
274fde9a36
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user