From 7f7cb8214961d95283571cba5e23791654bfcd8a Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Wed, 16 Mar 2016 16:38:13 +0100 Subject: [PATCH] *: fix response body leaks Signed-off-by: Antonio Murdaca --- docs/session.go | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/session.go b/docs/session.go index bd0dfb2cb..5647ad286 100644 --- a/docs/session.go +++ b/docs/session.go @@ -284,6 +284,7 @@ func (r *Session) GetRemoteImageLayer(imgID, registry string, imgSize int64) (io res, err = r.client.Do(req) if err != nil { logrus.Debugf("Error contacting registry %s: %v", registry, err) + // the only case err != nil && res != nil is https://golang.org/src/net/http/client.go#L515 if res != nil { if res.Body != nil { res.Body.Close()