From e4d45e8c260fc31dc0720000605218a70f1b175b Mon Sep 17 00:00:00 2001 From: Jeff Hodges Date: Mon, 14 Dec 2015 11:27:14 -0800 Subject: [PATCH] defer http response close higher up in va Updates #1266 because it's a better fix. --- va/validation-authority.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/va/validation-authority.go b/va/validation-authority.go index 3466f3947..67ce869fe 100644 --- a/va/validation-authority.go +++ b/va/validation-authority.go @@ -267,6 +267,7 @@ func (va *ValidationAuthorityImpl) fetchHTTP(identifier core.AcmeIdentifier, pat va.log.Debug(strings.Join([]string{challenge.Error.Error(), err.Error()}, ": ")) return emptyBody, challenge, err } + defer httpResponse.Body.Close() if httpResponse.StatusCode != 200 { challenge.Status = core.StatusInvalid @@ -288,7 +289,6 @@ func (va *ValidationAuthorityImpl) fetchHTTP(identifier core.AcmeIdentifier, pat } return emptyBody, challenge, err } - httpResponse.Body.Close() return body, challenge, nil }