diff --git a/capetest/capetest.go b/capetest/capetest.go index c685713d..8924b0a9 100644 --- a/capetest/capetest.go +++ b/capetest/capetest.go @@ -80,6 +80,7 @@ func CapeTest(testReq TestRequest, endpoint string, insecure bool, pcrSlice []st } return nil, err } + defer conn.Close() nonce, err := crypto.GetNonce() if err != nil { diff --git a/cmd/cape/cmd/deploy.go b/cmd/cape/cmd/deploy.go index 7bbff0f4..6e5085d8 100644 --- a/cmd/cape/cmd/deploy.go +++ b/cmd/cape/cmd/deploy.go @@ -220,6 +220,7 @@ func doDeploy(url string, name string, reader io.Reader, insecure bool, pcrSlice } return "", nil, err } + defer conn.Close() p := runner.Protocol{Websocket: conn} diff --git a/cmd/cape/cmd/run.go b/cmd/cape/cmd/run.go index 989c94ef..5e8ad1f4 100644 --- a/cmd/cape/cmd/run.go +++ b/cmd/cape/cmd/run.go @@ -163,6 +163,8 @@ func doRun(url string, functionID string, data []byte, insecure bool, funcHash [ } return nil, err } + defer c.Close() + nonce, err := crypto.GetNonce() if err != nil { return nil, err