1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

[several modules] Close the response body (#1040)

This commit is contained in:
David Bouchare
2021-01-16 21:36:29 +01:00
committed by GitHub
parent a5f66588e7
commit 49109c77f7
12 changed files with 14 additions and 0 deletions

View File

@@ -65,6 +65,7 @@ func apiRequest() (*http.Response, error) {
if err != nil {
return nil, err
}
defer func() { _ = resp.Body.Close() }()
if resp.StatusCode != 200 {
return nil, fmt.Errorf(resp.Status)