diff --git a/internal/oci/runtime_oci.go b/internal/oci/runtime_oci.go index 6401cdb88d2..abe7c18918f 100644 --- a/internal/oci/runtime_oci.go +++ b/internal/oci/runtime_oci.go @@ -166,8 +166,8 @@ func (r *runtimeOCI) CreateContainer(ctx context.Context, c *Container, cgroupPa // 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 }