rpc: fix leak by close http body #29223 (#1013)

This commit is contained in:
Daniel Liu 2025-04-29 17:10:12 +08:00 committed by GitHub
parent 656419ba14
commit fa39dac391
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -235,7 +235,7 @@ func (hc *httpConn) doRequest(ctx context.Context, msg interface{}) (io.ReadClos
if _, err := buf.ReadFrom(resp.Body); err == nil {
body = buf.Bytes()
}
resp.Body.Close()
return nil, HTTPError{
Status: resp.Status,
StatusCode: resp.StatusCode,