From 603cdfb62064db8abaee1e10e2cd0f1e1cce47fd Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Thu, 9 Mar 2023 04:00:02 -0700 Subject: [PATCH] fix(inputs.ethtool): Close namespace (#12815) --- plugins/inputs/ethtool/ethtool_linux.go | 1 + 1 file changed, 1 insertion(+) 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