Always close response body (#10697)

This commit is contained in:
Ritesh H Shukla 2020-10-16 12:40:36 -07:00 committed by GitHub
parent 1aec168c84
commit 73a41a725a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,8 +42,8 @@ func (adm *AdminClient) GetBucketBandwidth(ctx context.Context, buckets ...strin
}
resp, err := adm.executeMethod(ctx, http.MethodGet, reqData)
defer closeResponse(resp)
if err != nil {
closeResponse(resp)
return bandwidth.Report{}, err
}
if resp.StatusCode != http.StatusOK {