Skip to content

Commit 2215630

Browse files
authored
Merge pull request #1175 from chienfuchen32/patch-1
Add http response close in client post function
2 parents c6f04ed + 152fb8b commit 2215630

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

api/client/client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ func (srv *server) post(url string, jsonData []byte) (*api.Response, error) {
157157
return nil, errors.Wrap(errors.APIClientError, errors.ClientHTTPError, err)
158158
}
159159
defer req.Body.Close()
160+
defer resp.Body.Close()
160161
body, err := ioutil.ReadAll(resp.Body)
161162
if err != nil {
162163
return nil, errors.Wrap(errors.APIClientError, errors.IOError, err)

0 commit comments

Comments
 (0)