diff --git a/command/helpers.go b/command/helpers.go index 9e64b974cf8..e27ed09b829 100644 --- a/command/helpers.go +++ b/command/helpers.go @@ -255,6 +255,10 @@ func (j *JobGetter) StructJob(jpath string) (*structs.Job, error) { } defer os.Remove(job.Name()) + if err := job.Close(); err != nil { + return nil, err + } + // Get the pwd pwd, err := os.Getwd() if err != nil {