mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: close the file opened in the captureHostObj function
Change-Id: I940c63c3040035e507428798d50060cfd0d04e16
GitHub-Last-Rev: e27484cd43
GitHub-Pull-Request: golang/go#66706
Reviewed-on: https://go-review.googlesource.com/c/go/+/577055
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Than McIntosh <thanm@google.com>
This commit is contained in:
parent
20f052c83c
commit
ddc6e165fd
1 changed files with 1 additions and 0 deletions
|
|
@ -2848,6 +2848,7 @@ func captureHostObj(h *Hostobj) {
|
|||
if err != nil {
|
||||
log.Fatalf("capturing host obj: open failed on %s: %v", h.pn, err)
|
||||
}
|
||||
defer inf.Close()
|
||||
res := make([]byte, h.length)
|
||||
if n, err := inf.ReadAt(res, h.off); err != nil || n != int(h.length) {
|
||||
log.Fatalf("capturing host obj: readat failed on %s: %v", h.pn, err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue