mirror of
https://github.com/containers/podman.git
synced 2026-07-09 14:54:59 -04:00
chrootarchive.Tar returns an io.ReadCloser backed by a pipe to the tar-producing process. CRCreateRootFsDiffTar copies from the stream but never closes it. On the successful path the stream is read to EOF, so the producer normally exits. On early errors, such as failing to create the destination file or failing while copying to it, the producer can be left without a consumer. Close the tar stream after it is created so error paths release the pipe and allow the producer to exit. Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko00@bk.ru>