Skip to content

Commit

Permalink
close body when ReadAll encounters error
Browse files Browse the repository at this point in the history
close #30464

Signed-off-by: Ryan Leung <rleungx@gmail.com>
  • Loading branch information
rleungx committed Dec 7, 2021
1 parent cb88a4c commit afdc138
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions domain/infosync/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ func doRequest(ctx context.Context, addrs []string, route, method string, body i
if err == nil {
bodyBytes, err := io.ReadAll(res.Body)
if err != nil {
terror.Log(res.Body.Close())
return nil, err
}
if res.StatusCode != http.StatusOK {
Expand Down

0 comments on commit afdc138

Please sign in to comment.