Skip to content

Commit

Permalink
infosync: close body when ReadAll encounters error (#30462)
Browse files Browse the repository at this point in the history
  • Loading branch information
rleungx authored Dec 7, 2021
1 parent 181c0c9 commit 7d4895f
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 7d4895f

Please sign in to comment.