From eae8ca69b7e1e52fb9548c996f6febf7b60cd8e5 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Tue, 28 Feb 2017 16:49:37 +0000 Subject: [PATCH] Do not leak open fd to config.json in newBundle Signed-off-by: Ian Campbell --- linux/runtime.go | 1 + 1 file changed, 1 insertion(+) diff --git a/linux/runtime.go b/linux/runtime.go index 8aca808..023fbb3 100644 --- a/linux/runtime.go +++ b/linux/runtime.go @@ -179,6 +179,7 @@ func (r *Runtime) newBundle(id string, spec []byte) (string, error) { if err != nil { return "", err } + defer f.Close() _, err = io.Copy(f, bytes.NewReader(spec)) return path, err }