]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix memory leaks in open_tun_dco()
authorArne Schwabe <arne@rfc2549.org>
Tue, 14 Mar 2023 14:48:54 +0000 (15:48 +0100)
committerGert Doering <gert@greenie.muc.de>
Tue, 14 Mar 2023 14:57:17 +0000 (15:57 +0100)
open_tun_dco_generic() already allocates the tt->actual_name string, which
shadows the allocation in the FreeBSD/Linux specific methods.

Found-By: clang with asan
Change-Id: I51f5fcfff4e5f8203fdb9aec0245cfccd17043cc
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20230314144854.182110-2-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26411.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/dco_freebsd.c
src/openvpn/dco_linux.c

index ecca2a0764844b37bdf63dc941708cdbce9042b7..225b3cf88df3ca6340b7ce055f7ba480903a2ef4 100644 (file)
@@ -232,7 +232,6 @@ create_interface(struct tuntap *tt, const char *dev)
     }
 
     snprintf(tt->dco.ifname, IFNAMSIZ, "%s", ifr.ifr_data);
-    tt->actual_name = string_alloc(tt->dco.ifname, NULL);
 
     /* see "Interface Flags" in ifnet(9) */
     int i = IFF_POINTOPOINT | IFF_MULTICAST;
index b2fdbf53f1d3123eb4f52c39c4996fb8a049ab60..e5cea3c719889f5ba374c0113c0fe4756079c79a 100644 (file)
@@ -457,7 +457,6 @@ open_tun_dco(struct tuntap *tt, openvpn_net_ctx_t *ctx, const char *dev)
         msg(M_FATAL, "DCO: cannot retrieve ifindex for interface %s", dev);
     }
 
-    tt->actual_name = string_alloc(dev, NULL);
     tt->dco.dco_message_peer_id = -1;
 
     ovpn_dco_register(&tt->dco);