Add calls to nvlist_destroy to avoid memory leaks#636
Add calls to nvlist_destroy to avoid memory leaks#636remif-stormshield wants to merge 1 commit intoOpenVPN:masterfrom
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
| { | ||
| 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.
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.
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 <remi.farault@stormshield.eu> Acked-by: Kristof Provost <kp@freebsd.org> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <f8845c0c5aa74e5bab537463249a251d@stormshield.eu> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg29701.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
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 <remi.farault@stormshield.eu> Acked-by: Kristof Provost <kp@freebsd.org> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <f8845c0c5aa74e5bab537463249a251d@stormshield.eu> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg29701.html Signed-off-by: Gert Doering <gert@greenie.muc.de> (cherry picked from commit dee0748)
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: OpenVPN#636 Signed-off-by: Rémi Farault <remi.farault@stormshield.eu> Acked-by: Kristof Provost <kp@freebsd.org> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <f8845c0c5aa74e5bab537463249a251d@stormshield.eu> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg29701.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
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.