cmd/link: avoid leaking file in ldshlibsyms

Change-Id: If27f7fbf94ede6f9a57f2520aaf75e6506e0b3f8
Reviewed-on: https://go-review.googlesource.com/59374
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
This commit is contained in:
Hiroshi Ioka 2017-08-22 19:50:43 +09:00 committed by Dave Cheney
parent b046878018
commit 6eef2bb5ee

View file

@ -1562,6 +1562,7 @@ func ldshlibsyms(ctxt *Link, shlib string) {
Errorf(nil, "cannot open shared library: %s", libpath)
return
}
defer f.Close()
hash, err := readnote(f, ELF_NOTE_GO_NAME, ELF_NOTE_GOABIHASH_TAG)
if err != nil {