diff --git a/utils_linux.go b/utils_linux.go index 46c26246..973c63a9 100644 --- a/utils_linux.go +++ b/utils_linux.go @@ -349,7 +349,9 @@ func (r *runner) run(config *specs.Process) (int, error) { if detach { return 0, nil } - r.destroy() + if err == nil { + r.destroy() + } return status, err }