Do not leak open fd to config.json in newBundle

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
This commit is contained in:
Ian Campbell 2017-02-28 16:49:37 +00:00
parent 4793f968e5
commit eae8ca69b7
1 changed files with 1 additions and 0 deletions

View File

@ -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
}