-
Notifications
You must be signed in to change notification settings - Fork 721
Fix memory leak 267 282 #290
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
Conversation
|
Hello, Would it be possible for you guys to kindly look at it and discuss / merge if needed? Best Regards, |
src/server/listener.cc
Outdated
| TRY(::listen(fd, backlog_)); | ||
| break; | ||
| } | ||
| freeaddrinfo(addrs); |
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.
This works in the common case, but will still fail to clean up resources if the "::listen()" fails 2 lines above (the 'TRY' macro will throw a different exception).
I suggest that you encapsulate 'getaddrinfo' into a RAII class so that it will clean itself up no matter how the method exits.
|
For some reason build is not triggered on my commit... |
|
gcc-7.3.0: |
|
This PR has merge conflicts, and the impacted code has since been heavily refactored. I'm going to close this PR, but welcome any future PRs. Thank you for your time. |
Issue #267:
Freeing first element in the Queue constructor
Issue #282:
Freeing allocated
addrsstructure after use.