mirror of
https://github.com/golang/go
synced 2024-11-23 00:40:08 -07:00
cmd/cgo: avoid leaking fds
Fixes #5714. R=golang-dev, iant CC=golang-dev https://golang.org/cl/10386043
This commit is contained in:
parent
7468b1d36a
commit
f9c22f7e78
@ -716,6 +716,7 @@ func (p *Package) gccDebug(stdin []byte) (*dwarf.Data, binary.ByteOrder, []byte)
|
||||
runGcc(stdin, p.gccCmd())
|
||||
|
||||
if f, err := macho.Open(gccTmp()); err == nil {
|
||||
defer f.Close()
|
||||
d, err := f.DWARF()
|
||||
if err != nil {
|
||||
fatalf("cannot load DWARF output from %s: %v", gccTmp(), err)
|
||||
@ -742,6 +743,7 @@ func (p *Package) gccDebug(stdin []byte) (*dwarf.Data, binary.ByteOrder, []byte)
|
||||
}
|
||||
|
||||
if f, err := elf.Open(gccTmp()); err == nil {
|
||||
defer f.Close()
|
||||
d, err := f.DWARF()
|
||||
if err != nil {
|
||||
fatalf("cannot load DWARF output from %s: %v", gccTmp(), err)
|
||||
@ -768,6 +770,7 @@ func (p *Package) gccDebug(stdin []byte) (*dwarf.Data, binary.ByteOrder, []byte)
|
||||
}
|
||||
|
||||
if f, err := pe.Open(gccTmp()); err == nil {
|
||||
defer f.Close()
|
||||
d, err := f.DWARF()
|
||||
if err != nil {
|
||||
fatalf("cannot load DWARF output from %s: %v", gccTmp(), err)
|
||||
|
Loading…
Reference in New Issue
Block a user