Skip to content
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

Possible socket leak when Bind fails #49

Closed
vulcanfan opened this issue Nov 23, 2020 · 0 comments · Fixed by #53
Closed

Possible socket leak when Bind fails #49

vulcanfan opened this issue Nov 23, 2020 · 0 comments · Fixed by #53

Comments

@vulcanfan
Copy link

Hi,

Just raising possible bug in line 215 of sctp_linux.go which says

err := SCTPBind(sock, laddr, SCTP_BINDX_ADD_ADDR)

whereby if the socket fails to bind for whatever reason the defer() to close the socket isn't called, and the socket leaks. Cause appears to be the := instead = above. Declaring a new err variable with := masks the err that is checked in the defer(). Suggest changing := to just = may resolve.

Thanks

ishidawataru added a commit that referenced this issue Feb 26, 2021
fixes #49

Signed-off-by: Wataru Ishida <wataru.ishid@gmail.com>
ishidawataru added a commit that referenced this issue Feb 26, 2021
fixes #49

Signed-off-by: Wataru Ishida <wataru.ishid@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant