From patchwork Mon Nov 9 12:46:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5621 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:63cb:10b0:11a:a05e:cb97 with SMTP id w11-n1csp613234lat; Mon, 9 Nov 2026 04:46:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErEpeMv2twn32tRhyyiELIhp7hV5+bES+sK3nye812nzM8J39wEDT5/b6YuEf+Z5s8NOQ7NBpLM85SM=@openvpn.net X-Received: by 2002:a05:7301:7c0e:b0:36e:2626:4ace with SMTP id 5a478bee46e88-3725b461abemr11171403eec.5.1794228396155; Mon, 09 Nov 2026 04:46:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794228396; cv=none; d=google.com; s=arc-20260327; b=H9AAdPU5LarYSVAqhk0YMqkCzBeGw3t+mryrrctVb56rDQgDnQSaFMmNNzfCiqjD0u 85zkNuvR5qqRKhvnMkXxL/2iX3FpsE3SqFHwpr6kBBNyAblvWflemOBESuW/lUfsx5xl FYtqn67MacsyjO0NzLXwb6f08nBAuypIGhyhCn+AwxIaf0A0n5deMTDvpIl2nGJy+BPQ 1KE6y8IMBJEXTYMPD/bLIaQbDoe4jTUHQYZzMycYz6JAdtHqVJkaZ6yfuQ467GL85Irv owxwNbypp3wUEC/+dSpcwHsyleqF37LkAN1qHtM6y+Ez1LSblCcqq6SnZ+tWP5Akc6ln HDpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=xfliC8xNf9rzMXa+AUPbGeEstNbTQd37i2MsCSjUg04=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=fGJNcYTMI9EQMk48q7I3WqDvCwqYf5y0ZBgBJu0pGlouYAExYDNvOwQkGBdpmW1T0W GWq5is2wVyAaS4/JOoAupN0X/UU5zKGhYC2HKp9Is1Hrl/8Gs9msUaWl7eNJ0JxVd4AC YIoaiVYr8DlJ/FsnqYdlaCROCFxAYnzznCHkjZmOo+ekm3F6W3apaUbRyuFaUc507FfP RVCjnvD8inyvYOguNKnSpx9fBXgr+xyEJs/PAjc2mmhXaKdzxHzvxOERoF4vBcLN2KgR BKMG2oTAzLnac/Xa+i1v4LsUUwesjwQcJmH29Jm9ETGl1DyPxAPODAb1vBw8bcFJsIxX +DwA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=K0g1opqR; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=nH5dfR7O; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=RM6wGJPl; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 5a478bee46e88-37265cfce6fsi16614918eec.37.2026.11.09.04.46.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Nov 2026 04:46:36 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=K0g1opqR; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=nH5dfR7O; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=RM6wGJPl; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=xfliC8xNf9rzMXa+AUPbGeEstNbTQd37i2MsCSjUg04=; b=K0g1opqR2/CKcD 9KIhPvYboAr7EnR3+VayApK4UAk5cgm201h6k4HdhIjgGsVvFdzpvT2OSOLRNqzkZ0wF6M2m+Dyii W0u5Ru+2pSv7j4XR33s9aBj1xANWPrndoqWzu8JDHgDB28iUana22L1Ms8bW3OwjFSciSdzBjwoN4 ri8=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.100.1) (envelope-from ) id 1xQOle-000000005uv-2BVm; Mon, 09 Nov 2026 12:46:34 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xQOld-000000005uk-2lKx for openvpn-devel@lists.sourceforge.net; Mon, 09 Nov 2026 12:46:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ac7EeguizYITJNTaPCnV4k04T0fAzTB5OL4bO6Exhwk=; b=nH5dfR7OxWOwt+VnwFlURpI7ej LbA+ja0PDWZmGqwDa2LDAvcyHhEtxjKov2/aMhcwXf0TiLw7kM1Q9ONlv9H0iXHC6YRmghTvjMzOY 7CYkJPGtv1wQnC5SWdqRRqfz3JjBdjgBCvTZ/JzUimIRXKoV0/QpEFihkC9xk6ony6d8=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ac7EeguizYITJNTaPCnV4k04T0fAzTB5OL4bO6Exhwk=; b=RM6wGJPlMuVZxaGTAoR1Pcdk+H XPxJY341Ef0mg31X2H+BIW8on2bNTRa+xgnbgV0iX5JwJS9zDISzMB0MKmkQ7gyG6tA4cEOqKgHMa WpQz8EyGgvVkk5zQBYZRAjYlQwYuF9TbZjYVbDmp+LMf2i+kO+6y6mHCOg+jlkEvz9Ik=; Received: from [193.149.48.129] (helo=blue.greenie.muc.de) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xQOlc-000000006Xt-0lFx for openvpn-devel@lists.sourceforge.net; Mon, 09 Nov 2026 12:46:33 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 6A9CkOKS026729 for ; Mon, 9 Nov 2026 13:46:24 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6A9CkOVD026728 for openvpn-devel@lists.sourceforge.net; Mon, 9 Nov 2026 13:46:24 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 9 Nov 2026 13:46:18 +0100 Message-ID: <20261109124623.26716-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.55.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-1.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Razvan Cojocaru These functions create and free a gc_arena they never allocate from. Change-Id: Iefcc3cb90f3e6b036a584a74268678dbc17da69f Signed-off-by: Razvan Cojocaru Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/o [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1xQOlc-000000006Xt-0lFx Subject: [Openvpn-devel] [PATCH v1] Remove unused gc_arena variables X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: 1881384834800928472 X-GMAIL-MSGID: 1881384834800928472 From: Razvan Cojocaru These functions create and free a gc_arena they never allocate from. Change-Id: Iefcc3cb90f3e6b036a584a74268678dbc17da69f Signed-off-by: Razvan Cojocaru Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2149 --- 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/+/2149 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/src/openvpn/init.c b/src/openvpn/init.c index ff3bfe5..3bc4de4 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -117,8 +117,6 @@ const char *ifconfig_remote, const char *context, const char *signal_text, const char *script_type, struct env_set *es) { - struct gc_arena gc = gc_new(); - if (signal_text) { setenv_str(es, "signal", signal_text); @@ -174,8 +172,6 @@ openvpn_run_script(&argv, es, S_FATAL, "--up/--down"); argv_free(&argv); } - - gc_free(&gc); } /* diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c index 58f63e6..3410253 100644 --- a/src/openvpn/manage.c +++ b/src/openvpn/manage.c @@ -2325,9 +2325,7 @@ if (!ignore_sys_error(err, crt_error)) { - struct gc_arena gc = gc_new(); msg(D_MANAGEMENT, "MANAGEMENT: TCP %s error: %s", prefix, strerror(err)); - gc_free(&gc); return true; } else @@ -3151,11 +3149,8 @@ management_notify_client_cr_response(unsigned mda_key_id, const struct man_def_auth_context *mdac, const struct env_set *es, const char *response) { - struct gc_arena gc; if (management) { - gc = gc_new(); - msg(M_CLIENT, ">CLIENT:CR_RESPONSE,%lu,%u,%s", mdac->cid, mda_key_id, response); man_output_extra_env(management, "CLIENT"); if (management->connection.env_filter_level > 0) @@ -3163,7 +3158,6 @@ man_output_peer_info_env(management, mdac); } man_output_env(es, true, management->connection.env_filter_level, "CLIENT"); - gc_free(&gc); } } diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 3f514d6..3e25a6e 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -726,7 +726,6 @@ multi_create_instance(struct multi_context *m, const struct mroute_addr *real, struct link_socket *sock) { - struct gc_arena gc = gc_new(); struct multi_instance *mi; msg(D_MULTI_MEDIUM, "MULTI: multi_create_instance called"); @@ -792,12 +791,10 @@ mi->ev_arg.type = EVENT_ARG_MULTI_INSTANCE; mi->ev_arg.u.mi = mi; - gc_free(&gc); return mi; err: multi_close_instance(m, mi, false); - gc_free(&gc); return NULL; } @@ -2243,7 +2240,6 @@ if (mi->context.options.client_connect_script) { struct argv argv = argv_new(); - struct gc_arena gc = gc_new(); setenv_str(mi->context.c2.es, "script_type", "client-connect"); @@ -2279,7 +2275,6 @@ ccs_delete_deferred_ret_file(mi); } argv_free(&argv); - gc_free(&gc); } return ret; } diff --git a/src/openvpn/options_string.c b/src/openvpn/options_string.c index cfc0595..ed4d742 100644 --- a/src/openvpn/options_string.c +++ b/src/openvpn/options_string.c @@ -344,7 +344,6 @@ bool options_cmp_equal_safe(char *actual, const char *expected, size_t actual_n) { - struct gc_arena gc = gc_new(); bool ret = true; if (actual_n > 0) @@ -360,7 +359,6 @@ ret = !strcmp(actual, expected); } } - gc_free(&gc); return ret; } diff --git a/src/openvpn/plugin.c b/src/openvpn/plugin.c index 08461b8..d1f228e 100644 --- a/src/openvpn/plugin.c +++ b/src/openvpn/plugin.c @@ -560,7 +560,6 @@ if (p->plugin_handle && (p->plugin_type_mask & OPENVPN_PLUGIN_MASK(type))) { - struct gc_arena gc = gc_new(); struct argv a = argv_insert_head(av, p->so_pathname); dmsg(D_PLUGIN_DEBUG, "PLUGIN_CALL: PRE type=%s", plugin_type_name(type)); @@ -609,7 +608,6 @@ } argv_free(&a); - gc_free(&gc); } return status; } diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 53550c4..d0d26c6 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -3090,7 +3090,6 @@ void get_default_gateway(struct route_gateway_info *rgi, in_addr_t dest, openvpn_net_ctx_t *ctx) { - struct gc_arena gc = gc_new(); int sd = -1; char best_name[IFNAMSIZ]; @@ -3216,7 +3215,6 @@ { close(sd); } - gc_free(&gc); } /* IPv6 implementation using netlink diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 307b5c6..1fbd07b 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -499,7 +499,6 @@ const struct addrinfo *local, bool do_listen, bool nowait, volatile int *signal_received) { - struct gc_arena gc = gc_new(); socket_descriptor_t new_sd = SOCKET_UNDEFINED; CLEAR(*act); @@ -521,7 +520,6 @@ get_signal(signal_received); if (*signal_received) { - gc_free(&gc); return sd; } @@ -552,7 +550,6 @@ tcp_connection_established(act); - gc_free(&gc); return new_sd; } @@ -803,8 +800,6 @@ static void resolve_bind_local(struct link_socket *sock) { - struct gc_arena gc = gc_new(); - /* resolve local address if undefined */ if (!sock->info.lsa->bind_local) { @@ -846,8 +841,6 @@ sock->info.af = (sa_family_t)sock->info.lsa->bind_local->ai_family; } } - - gc_free(&gc); } static void @@ -2673,7 +2666,6 @@ void socket_bind_unix(socket_descriptor_t sd, struct sockaddr_un *local, const char *prefix) { - struct gc_arena gc = gc_new(); const mode_t orig_umask = umask(0); if (bind(sd, (struct sockaddr *)local, sizeof(struct sockaddr_un))) @@ -2683,7 +2675,6 @@ } umask(orig_umask); - gc_free(&gc); } socket_descriptor_t diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 943ad9f..bcea331 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -666,7 +666,6 @@ void warn_on_use_of_common_subnets(openvpn_net_ctx_t *ctx) { - struct gc_arena gc = gc_new(); struct route_gateway_info rgi; const unsigned int needed = (RGI_ADDR_DEFINED | RGI_NETMASK_DEFINED); @@ -680,7 +679,6 @@ "NOTE: your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x. Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet."); } } - gc_free(&gc); } /*