From: Razvan Cojocaru <[email protected]>
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
---
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/+/2092
This mail reflects revision 2 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]>
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
{
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel