Close resp body on plugin call error

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 93ad9c31fce375b29606ea347df28c1205e7cb41
Component: engine
This commit is contained in:
Brian Goff
2016-02-24 20:09:51 -05:00
parent ab6aa3583c
commit 1ca6d4e7c1

View File

@ -124,6 +124,7 @@ func (c *Client) callWithRetry(serviceMethod string, data io.Reader, retry bool)
if resp.StatusCode != http.StatusOK {
b, err := ioutil.ReadAll(resp.Body)
resp.Body.Close()
if err != nil {
return nil, &statusError{resp.StatusCode, serviceMethod, err.Error()}
}