summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot/controller.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2018-11-09 14:53:24 -0800
committerShentubot <shentubot@google.com>2018-11-09 14:54:34 -0800
commitd97ccfa346d23d99dcbe634a10fa5d81b089100d (patch)
treec34558af32ed78e4cb7bcc45b164269c0b4be57e /runsc/boot/controller.go
parent33089561b1d53dada959a312ab69574cd6635b4b (diff)
Close donated files if containerManager.Start() fails
PiperOrigin-RevId: 220869535 Change-Id: I9917e5daf02499f7aab6e2aa4051c54ff4461b9a
Diffstat (limited to 'runsc/boot/controller.go')
-rw-r--r--runsc/boot/controller.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/runsc/boot/controller.go b/runsc/boot/controller.go
index 568aad117..7a1f42119 100644
--- a/runsc/boot/controller.go
+++ b/runsc/boot/controller.go
@@ -213,6 +213,12 @@ type StartArgs struct {
func (cm *containerManager) Start(args *StartArgs, _ *struct{}) error {
log.Debugf("containerManager.Start: %+v", args)
+ defer func() {
+ for _, f := range args.FilePayload.Files {
+ f.Close()
+ }
+ }()
+
// Validate arguments.
if args == nil {
return errors.New("start missing arguments")