mirror of https://github.com/docker/docs.git
Close resp body on plugin call error
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
a7fefcf16c
commit
93ad9c31fc
|
@ -124,6 +124,7 @@ func (c *Client) callWithRetry(serviceMethod string, data io.Reader, retry bool)
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
b, err := ioutil.ReadAll(resp.Body)
|
b, err := ioutil.ReadAll(resp.Body)
|
||||||
|
resp.Body.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, &statusError{resp.StatusCode, serviceMethod, err.Error()}
|
return nil, &statusError{resp.StatusCode, serviceMethod, err.Error()}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue