mirror of
https://github.com/eko/pihole-exporter.git
synced 2024-12-23 16:07:57 +01:00
Merge pull request #157 from pecastro/fix_tcp_connection_leak
Close client connection when done.
This commit is contained in:
commit
3b7aaa0f23
@ -201,6 +201,7 @@ func (c *Client) getStatistics() (*Stats, error) {
|
||||
return nil, fmt.Errorf("an error has occured during retrieving PI-Hole statistics: %w", err)
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to read PI-Hole statistics HTTP response: %w", err)
|
||||
|
Loading…
Reference in New Issue
Block a user