mirror of https://github.com/containers/podman.git
api: Add error check
Add error check during tmpfile close. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Tigran Sogomonian <tsogomonian@astralinux.ru>
This commit is contained in:
parent
c05987ddd3
commit
9f5bbecb95
|
@ -410,7 +410,10 @@ func ImagesImport(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
tmpfile.Close()
|
||||
if err := tmpfile.Close(); err != nil {
|
||||
utils.Error(w, http.StatusInternalServerError, fmt.Errorf("unable to close tempfile: %w", err))
|
||||
return
|
||||
}
|
||||
source = tmpfile.Name()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue