From 2c240563741c58162ccdd21edc7b3732026cd433 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Fri, 30 Oct 2015 15:38:55 -0600 Subject: [PATCH] Close leaky file descriptors --- acme/crypto.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/acme/crypto.go b/acme/crypto.go index add4d053..608ec7d4 100644 --- a/acme/crypto.go +++ b/acme/crypto.go @@ -63,6 +63,7 @@ func GetOCSPForCert(bundle []byte) ([]byte, int, error) { if err != nil { return nil, OCSPUnknown, err } + defer resp.Body.Close() issuerBytes, err := ioutil.ReadAll(resp.Body) if err != nil { @@ -96,6 +97,7 @@ func GetOCSPForCert(bundle []byte) ([]byte, int, error) { if err != nil { return nil, OCSPUnknown, err } + defer req.Body.Close() ocspResBytes, err := ioutil.ReadAll(req.Body) ocspRes, err := ocsp.ParseResponse(ocspResBytes, issuerCert)