Gert Doering has submitted this change. ( https://gerrit.openvpn.net/c/openvpn/+/1992?usp=email )
Change subject: PUSH_UPDATE server: free temporary options after sending message ...................................................................... PUSH_UPDATE server: free temporary options after sending message Clean up options on success and send failure to avoid leaking memory allocated while parsing outgoing updates. Change-Id: Ie4a7e0702a30d2a637c3dfe03f6c62d8a9901aae Signed-off-by: Marco Baffo <[email protected]> Acked-by: Razvan Cojocaru <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1992 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg39864.html Signed-off-by: Gert Doering <[email protected]> --- M src/openvpn/push_util.c M tests/unit_tests/openvpn/mock_push_dependencies.c 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/src/openvpn/push_util.c b/src/openvpn/push_util.c index 7fa5987..34cb26c 100644 --- a/src/openvpn/push_util.c +++ b/src/openvpn/push_util.c @@ -163,6 +163,7 @@ { if (!send_control_channel_string(c, BSTR(&e->buf), D_PUSH)) { + uninit_options(&o); return false; } @@ -217,6 +218,7 @@ update_vhash(m, mi, o.ifconfig_local, o.ifconfig_ipv6_local); } + uninit_options(&o); return true; } diff --git a/tests/unit_tests/openvpn/mock_push_dependencies.c b/tests/unit_tests/openvpn/mock_push_dependencies.c index 112bcfd..bf2ccf3 100644 --- a/tests/unit_tests/openvpn/mock_push_dependencies.c +++ b/tests/unit_tests/openvpn/mock_push_dependencies.c @@ -62,6 +62,13 @@ { } +void +uninit_options(struct options *options) +{ + gc_free(&options->gc); + gc_free(&options->dns_options.gc); +} + bool options_postprocess_pull(struct options *options, struct env_set *es) { -- To view, visit https://gerrit.openvpn.net/c/openvpn/+/1992?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.openvpn.net/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ie4a7e0702a30d2a637c3dfe03f6c62d8a9901aae Gerrit-Change-Number: 1992 Gerrit-PatchSet: 3 Gerrit-Owner: Marco Baffo <[email protected]> Gerrit-Reviewer: Arne Schwabe <[email protected]> Gerrit-Reviewer: Răzvan Cojocaru <[email protected]> Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
