Replies: 1 comment 1 reply
-
Thanks for reporting, could you open a PR? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone, I was reading the nerdctl codebase to understand how networking is handled with containerd. Inside
pkg/internal/filesystem/lock.gothere is a function calledcommonLock, and within it there is a deferred function that callsfile.Close(). The problem is that in every error path, the file is either already closed or still nil, so if an error occurs, the deferred function will callClose()on a nil pointer, resulting in a panic.This is an edge case, but it can be resolved by simply removing the
file.Close()call inside the deferred function.I can open a PR if that would be helpful.
Here is a snippet of the function I am referring to:
Beta Was this translation helpful? Give feedback.
All reactions