diff --git a/utils/utils.go b/utils/utils.go index f73672c7a4..08b2fa37a0 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -77,6 +77,7 @@ func TarToFilesystem(source string, tarball *os.File) error { if err != nil { return err } + defer tb.Close() _, err = io.Copy(tarball, tb) if err != nil { return err @@ -98,6 +99,7 @@ func TarChrootToFilesystem(source string, tarball *os.File) error { if err != nil { return err } + defer tb.Close() _, err = io.Copy(tarball, tb) if err != nil { return err