mirror of
https://github.com/FlipsideCrypto/dcrd.git
synced 2026-02-06 10:56:47 +00:00
rpcclient: close the unused response body
This commit is contained in:
parent
3e2208f8c1
commit
29064448cb
@ -1222,6 +1222,9 @@ func dial(config *ConnConfig) (*websocket.Conn, error) {
|
||||
// Dial the connection.
|
||||
url := fmt.Sprintf("%s://%s/%s", scheme, config.Host, config.Endpoint)
|
||||
wsConn, resp, err := dialer.Dial(url, requestHeader)
|
||||
if resp != nil {
|
||||
resp.Body.Close()
|
||||
}
|
||||
if err != nil {
|
||||
if err != websocket.ErrBadHandshake || resp == nil {
|
||||
return nil, err
|
||||
|
||||
Loading…
Reference in New Issue
Block a user