mirror of https://github.com/containers/podman.git
Merge pull request #19534 from giuseppe/cp-close-tmp-file
cp: close temporary file on error path
This commit is contained in:
commit
c13b403c0f
|
@ -386,6 +386,7 @@ func copyToContainer(container string, containerPath string, hostPath string) er
|
|||
|
||||
_, err = io.Copy(tmpFile, os.Stdin)
|
||||
if err != nil {
|
||||
_ = tmpFile.Close()
|
||||
return err
|
||||
}
|
||||
if err = tmpFile.Close(); err != nil {
|
||||
|
|
Loading…
Reference in New Issue