cmd/link: close input files when copying to temporary directory

Fixes #29110

Change-Id: I077d1a9caa7f4545de1418cec718c4a37ac36ef8
Reviewed-on: https://go-review.googlesource.com/c/152757
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Ian Lance Taylor 2018-12-05 09:52:19 -08:00
parent ccb8735ba2
commit 35435b27c4

View File

@ -1017,6 +1017,7 @@ func hostobjCopy() (paths []string) {
if err != nil {
Exitf("cannot reopen %s: %v", h.pn, err)
}
defer f.Close()
if _, err := f.Seek(h.off, 0); err != nil {
Exitf("cannot seek %s: %v", h.pn, err)
}