Merge pull request #19534 from giuseppe/cp-close-tmp-file

cp: close temporary file on error path
This commit is contained in:
OpenShift Merge Robot 2023-08-08 08:38:06 -04:00 committed by GitHub
commit c13b403c0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -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 {