Merge pull request #20680 from cpuguy83/close_plugin_req_body_on_error

Close resp body on plugin call error
This commit is contained in:
Vincent Demeester
2016-02-25 09:10:17 +01:00

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()}
}