From f5003987dade3a1ff5b9f5f985636a04a75c8dd2 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Wed, 24 Feb 2016 20:09:51 -0500 Subject: [PATCH] Close resp body on plugin call error Signed-off-by: Brian Goff --- plugins/client.go | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/client.go b/plugins/client.go index 985f656..85dbb80 100644 --- a/plugins/client.go +++ b/plugins/client.go @@ -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()} }