Skip to content

Commit 526a861

Browse files
mlaventurecrosbymichael
authored andcommitted
Avoid panicing if cmd.Start() from container.createCmd() failed (containerd#305)
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
1 parent 403ccb1 commit 526a861

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

runtime/process.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,9 @@ func (p *process) Start() error {
297297
}
298298
case <-p.cmdDoneCh:
299299
if !p.cmdSuccess {
300-
cmd.Process.Kill()
300+
if cmd.Process != nil {
301+
cmd.Process.Kill()
302+
}
301303
cmd.Wait()
302304
return ErrShimExited
303305
}

0 commit comments

Comments
 (0)