-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: Remove double close in ImportImages #24269
base: main
Are you sure you want to change the base?
Conversation
tmpfile is closed using defer. Remove explicit closing. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Tigran Sogomonian <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mi4r, vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Ephemeral COPR build failed. @containers/packit-build please check. |
1 similar comment
Ephemeral COPR build failed. @containers/packit-build please check. |
pkg/api/handlers/libpod/images.go
Outdated
@@ -410,7 +410,6 @@ func ImagesImport(w http.ResponseWriter, r *http.Request) { | |||
return | |||
} | |||
|
|||
tmpfile.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the current code is not doing this correct either but I think there is a real reason to call close here and not via defer close(). close() can return real write errors so it likely is best to ensure the file is closed and we check that there was no error before passing that to file path to import.
One close is returned to its place, the second one is replaced in the body of the error condition. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Тигран Согомонян <[email protected]>
There were accidently added changes |
I will form new clean merge request |
please see my comments in #24277 |
tmpfile is closed using defer. Remove explicit closing.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Does this PR introduce a user-facing change?