From: Ian Lance Taylor Date: Mon, 16 Jul 2018 23:17:27 +0000 (-0700) Subject: cmd/internal/buildid: close ELF file after reading note X-Git-Tag: go1.11beta2~85 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=274fde9a36bf62f62f9ffda4b178df437649e8bf;p=gostls13.git 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 Reviewed-by: Brad Fitzpatrick --- diff --git a/src/cmd/internal/buildid/note.go b/src/cmd/internal/buildid/note.go index 5895da906a..2d26ea9961 100644 --- a/src/cmd/internal/buildid/note.go +++ b/src/cmd/internal/buildid/note.go @@ -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