]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/buildid: close ELF file after reading note
authorIan Lance Taylor <iant@golang.org>
Mon, 16 Jul 2018 23:17:27 +0000 (16:17 -0700)
committerIan Lance Taylor <iant@golang.org>
Mon, 16 Jul 2018 23:37:14 +0000 (23:37 +0000)
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>
src/cmd/internal/buildid/note.go

index 5895da906aac650e51e21d67f6eff0c28c82851d..2d26ea9961cd5bf7f59d7acf79445da465b281c9 100644 (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