Merge pull request #7 from amuhametov/master

ensure all fd closed
main
James Mills 1 week ago
commit 47aab65eed
Signed by: prologic
GPG Key ID: AC4C014F1440EBD6
  1. 2
      netstat/netstat_linux.go

@ -221,6 +221,7 @@ func (p *procFd) iterFdDir() {
z := bytes.SplitN(buf[:n], []byte(" "), 3)
name := getProcName(z[1])
p.p = &Process{p.pid, name}
stat.Close()
}
sk.Process = p.p
}
@ -251,6 +252,7 @@ func extractProcInfo(sktab []SockTabEntry) {
// doNetstat - collect information about network port status
func doNetstat(path string, fn AcceptFn) ([]SockTabEntry, error) {
f, err := os.Open(path)
defer f.Close()
if err != nil {
return nil, err
}

Loading…
Cancel
Save