diff --git a/probe/endpoint/procspy/spy_linux.go b/probe/endpoint/procspy/spy_linux.go index 08d4258c5..d3b222323 100644 --- a/probe/endpoint/procspy/spy_linux.go +++ b/probe/endpoint/procspy/spy_linux.go @@ -28,6 +28,11 @@ func (c *pnConnIter) Next() *Connection { } if proc, ok := c.procs[n.Inode]; ok { n.Proc = *proc + } else { + // ProcNet.Next() always returns a pointer to the same + // struct. We therefore must clear any garbage left over from + // the previous call. + n.Proc = Proc{} } return n }