Merge pull request #20680 from cpuguy83/close_plugin_req_body_on_error

Close resp body on plugin call error
Upstream-commit: a13945dd169b8ec83a3f17103a47ce124c024c03
Component: engine
This commit is contained in:
Vincent Demeester
2016-02-25 09:10:17 +01:00
+1
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()}
}