Fix SIGSEGV in proxyDialer

Incase of error, the response from net/HTTP ReadResponse is always
nil and no need to close the Body.

Signed-off-by: T K Chandra Hasan <t.k.chandra.hasan@ibm.com>
pull/36726/head
T K Chandra Hasan 11 months ago
parent cbed4cdedc
commit f2bc916487
No known key found for this signature in database
GPG Key ID: 6ED262543ADEC5CB

@ -100,7 +100,6 @@ func (p *proxyDialer) Dial(network, addr string) (net.Conn, error) {
res, err := http.ReadResponse(bufio.NewReader(c), req)
if err != nil {
res.Body.Close()
c.Close()
return nil, err
}

Loading…
Cancel
Save