mirror of https://github.com/containers/podman.git
api: Replace close function in condition body
The close is replaced in the body of the error condition. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Tigran Sogomonian <tsogomonian@astralinux.ru>
This commit is contained in:
parent
1dcb4c58c2
commit
c05987ddd3
|
@ -403,10 +403,10 @@ func ImagesImport(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
defer os.Remove(tmpfile.Name())
|
||||
defer tmpfile.Close()
|
||||
|
||||
if _, err := io.Copy(tmpfile, r.Body); err != nil && err != io.EOF {
|
||||
utils.Error(w, http.StatusInternalServerError, fmt.Errorf("unable to write archive to temporary file: %w", err))
|
||||
tmpfile.Close()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue