Skip to content

Commit

Permalink
Fix memory/file descriptor leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
rossigee committed Sep 5, 2022
1 parent fa72e2a commit 70084ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions exporters/openvpnas_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ func (e *OpenVPNExporter) Collect(ch chan<- prometheus.Metric) {

opts := []xmlrpc.Option{xmlrpc.HttpClient(&httpc)}
client, _ := xmlrpc.NewClient("http://localhost/", opts...)
defer client.Close()


err := e.CollectVPNSummary(*client, ch)
if err != nil {
Expand Down

0 comments on commit 70084ab

Please sign in to comment.