mirror of
https://github.com/golang/go
synced 2024-11-15 05:20:21 -07:00
cmd/link: close the file opened in the captureHostObj function
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
This commit is contained in:
parent
58c5db3169
commit
e27484cd43
@ -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…
Reference in New Issue
Block a user