From: Marco Baffo <[email protected]> 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 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1992 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Razvan Cojocaru <[email protected]> diff --git a/src/openvpn/push_util.c b/src/openvpn/push_util.c index 0213041..f867a8c 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) { _______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
