diff --git a/plugins/inputs/ethtool/ethtool_linux.go b/plugins/inputs/ethtool/ethtool_linux.go index 52bf33290..7fcd4cc21 100644 --- a/plugins/inputs/ethtool/ethtool_linux.go +++ b/plugins/inputs/ethtool/ethtool_linux.go @@ -243,6 +243,7 @@ func (c *CommandEthtool) Interfaces(includeNamespaces bool) ([]NamespacedInterfa c.Log.Errorf("Could not get initial namespace: %s", err) return nil, err } + defer initialNamespace.Close() // Gather the list of namespace names to from which to retrieve interfaces. initialNamespaceIsNamed := false