Gert Doering has submitted this change. (
https://gerrit.openvpn.net/c/openvpn/+/2092?usp=email )
Change subject: tun: free gc arena in windows_set_mtu()
......................................................................
tun: free gc arena in windows_set_mtu()
The arena used for strerror_win32() was never freed. Allocate it
only on the error path, where it is used.
Broken since 0213f80e ("Set the correct mtu on windows based systems").
Change-Id: I80b9969f555d670bc101635318d245d1b2de8ec5
Signed-off-by: Razvan Cojocaru <[email protected]>
Acked-by: Gert Doering <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2092
Message-Id: <[email protected]>
URL:
https://lore.kernel.org/openvpn-devel/[email protected]
Signed-off-by: Gert Doering <[email protected]>
---
M src/openvpn/tun.c
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index fdd13ae..58f4750 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -5203,7 +5203,6 @@
windows_set_mtu(const int iface_index, const short family, const int mtu)
{
DWORD err = 0;
- struct gc_arena gc = gc_new();
MIB_IPINTERFACE_ROW ipiface;
InitializeIpInterfaceEntry(&ipiface);
const char *family_name = (family == AF_INET6) ? "IPv6" : "IPv4";
@@ -5228,8 +5227,10 @@
if (err != NO_ERROR)
{
+ struct gc_arena gc = gc_new();
msg(M_WARN, "TUN: Setting %s mtu failed: %s [status=%lu if_index=%d]",
family_name,
strerror_win32(err, &gc), err, iface_index);
+ gc_free(&gc);
}
else
{
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2092?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: I80b9969f555d670bc101635318d245d1b2de8ec5
Gerrit-Change-Number: 2092
Gerrit-PatchSet: 3
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Gert Doering <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel