-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add calls to nvlist_destroy to avoid memory leaks #636
Add calls to nvlist_destroy to avoid memory leaks #636
Conversation
Thanks for that. Copying in @kprovost as the initial author of the When approved, we'd ask you to send the patch to the |
LGTM It's a common problem with nvlists-in-nvlists, and it's not the first time it's caught me. |
THAT was quick, I just see the patch come in via the list - thanks, will take it from there. |
haha yeah I sent it just after opening the PR, but wasn't sure the mail was received yet. |
src/openvpn/dco_freebsd.c
Outdated
} | ||
|
||
if (remoteaddr) | ||
{ | ||
nvlist_add_nvlist(nvl, "remote", sockaddr_to_nvlist(remoteaddr)); | ||
remote_nvl = sockaddr_to_nvlist(remoteaddr); | ||
nvlist_add_nvlist(nvl, "remote", remove_nvl); |
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.
remove_nvl
is not remote_nvl
, so this won't work :-) - I've replied by mail to the list post, and asked for a v2 there.
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.
oops, sorry for this, I sent the patch too quickly... I'll send a corrected v2 today
882f6b9
to
c2df7d0
Compare
Some memory leaks were detected by valgrind on the openvpn daemon, using DCO mode on a FreeBSD platform. The leaks are caused by missing nvlist_destroy calls in the file dco_freebsd.c. Calls to nvlist_destroy were added, sometimes using local variables to store nvlist pointers temporarly. A valgrind run on the updated daemon confirmed that the leaks were gone. Github: #636 Signed-off-by: Rémi Farault <[email protected]> Acked-by: Kristof Provost <[email protected]> Acked-by: Gert Doering <[email protected]> Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg29701.html Signed-off-by: Gert Doering <[email protected]>
Some memory leaks were detected by valgrind on the openvpn daemon, using DCO mode on a FreeBSD platform. The leaks are caused by missing nvlist_destroy calls in the file dco_freebsd.c. Calls to nvlist_destroy were added, sometimes using local variables to store nvlist pointers temporarly. A valgrind run on the updated daemon confirmed that the leaks were gone. Github: #636 Signed-off-by: Rémi Farault <[email protected]> Acked-by: Kristof Provost <[email protected]> Acked-by: Gert Doering <[email protected]> Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg29701.html Signed-off-by: Gert Doering <[email protected]> (cherry picked from commit dee0748)
Fix nvlist memory leaks
Issue
Some memory leaks were detected by valgrind on the openvpn daemon, using DCO mode on a FreeBSD platform.
The leaks are caused by missing nvlist_destroy calls in the file dco_freebsd.c.
Patch content
Calls to nvlist_destroy were added, sometimes using local variables to store nvlist pointers temporarly.
A valgrind run on the updated daemon confirmed that the leaks were gone.