]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: close input files when copying to temporary directory
authorIan Lance Taylor <iant@golang.org>
Wed, 5 Dec 2018 17:52:19 +0000 (09:52 -0800)
committerIan Lance Taylor <iant@golang.org>
Wed, 5 Dec 2018 18:18:12 +0000 (18:18 +0000)
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>
src/cmd/link/internal/ld/lib.go

index 6c5bc542a77c477a51f152753dce16de54a52eb6..755693b27ec74371cc4316c084c07fd1e8bc1cc0 100644 (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)
                        }