fixing SIGSEGV when running containers

Signed-off-by: Yassine TIJANI <yasstij11@gmail.com>

moving the deffering of the close after the error checking

Signed-off-by: Yassine TIJANI <yasstij11@gmail.com>

fixing SIGSEGV when running containers

Signed-off-by: Yassine TIJANI <yasstij11@gmail.com>
This commit is contained in:
Yassine TIJANI 2017-07-06 15:03:21 +02:00
parent 1aa82bc7df
commit 45b0e7cf1a
1 changed files with 2 additions and 1 deletions

View File

@ -190,10 +190,11 @@ func runContainer(dockerCli *command.DockerCli, opts *runOptions, copts *contain
} }
close, err := attachContainer(ctx, dockerCli, &errCh, config, createResponse.ID) close, err := attachContainer(ctx, dockerCli, &errCh, config, createResponse.ID)
defer close()
if err != nil { if err != nil {
return err return err
} }
defer close()
} }
statusChan := waitExitOrRemoved(ctx, dockerCli, createResponse.ID, copts.autoRemove) statusChan := waitExitOrRemoved(ctx, dockerCli, createResponse.ID, copts.autoRemove)