diff --git a/internal/oci/runtime_oci.go b/internal/oci/runtime_oci.go index cdaf6c51322..cfcd096449c 100644 --- a/internal/oci/runtime_oci.go +++ b/internal/oci/runtime_oci.go @@ -159,8 +159,8 @@ func (r *runtimeOCI) CreateContainer(c *Container, cgroupParent string) (retErr // Platform specific container setup if err := r.createContainerPlatform(c, cgroupParent, cmd.Process.Pid); err != nil { - if waitErr := cmd.Wait(); waitErr != nil { - return errors.Wrap(err, waitErr.Error()) + if killErr := cmd.Process.Kill(); killErr != nil { + return errors.Wrap(err, killErr.Error()) } return err }