Merge pull request #20823 from nalind/close-that-readcloser
utils: close a couple of ReadClosers
This commit is contained in:
commit
e0a524f630
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue