Merge pull request #157 from pecastro/fix_tcp_connection_leak
Close client connection when done.
This commit is contained in:
commit
3b7aaa0f23
1 changed files with 1 additions and 0 deletions
|
@ -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)
|
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)
|
body, err := ioutil.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("unable to read PI-Hole statistics HTTP response: %w", err)
|
return nil, fmt.Errorf("unable to read PI-Hole statistics HTTP response: %w", err)
|
||||||
|
|
Loading…
Reference in a new issue