Browse code

Close resp body on plugin call error

Signed-off-by: Brian Goff <cpuguy83@gmail.com>

Brian Goff authored on 2016/02/25 10:09:51
Showing 1 changed files
... ...
@@ -124,6 +124,7 @@ func (c *Client) callWithRetry(serviceMethod string, data io.Reader, retry bool)
124 124
 
125 125
 		if resp.StatusCode != http.StatusOK {
126 126
 			b, err := ioutil.ReadAll(resp.Body)
127
+			resp.Body.Close()
127 128
 			if err != nil {
128 129
 				return nil, &statusError{resp.StatusCode, serviceMethod, err.Error()}
129 130
 			}