diff --git a/openvpn_exporter.go b/openvpn_exporter.go index 8309f44..8babecb 100644 --- a/openvpn_exporter.go +++ b/openvpn_exporter.go @@ -278,6 +278,7 @@ func CollectClientStatusFromReader(statusPath string, file io.Reader, ch chan<- func CollectStatusFromFile(statusPath string, ch chan<- prometheus.Metric) error { conn, err := os.Open(statusPath) + defer conn.Close() if err != nil { return err }