mirror of
https://github.com/containers/podman.git
synced 2025-07-02 16:57:24 +08:00
utils: close a couple of ReadClosers
utils.Tar() and utils.TarWithChroot() both return ReadClosers, but when we called them from utils.TarToFilesystem() and utils.TarChrootToFilesystem() respectively, they were not being closed. [NO NEW TESTS NEEDED] Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user