[Openvpn-devel,v1] PUSH_UPDATE server: free temporary options after sending message
| Message ID | 20261013121338.27882-1-gert@greenie.muc.de |
|---|---|
| State | New |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net>
Delivered-To: patchwork@openvpn.net
Received: by 2002:a05:7000:5249:b0:8d7:ebbe:b250 with SMTP id e9csp408426mag;
Tue, 13 Oct 2026 05:13:54 -0700 (PDT)
X-Forwarded-Encrypted: i=2;
AKwUvByF7qacJuoLTRZm7b9xUzKEeJqK6DYMeGutCzEzFl3Abog6IVdEOff2u3E0/a5It5G6MwEHiMj7iZo=@openvpn.net
X-Received: by 2002:a05:6808:6614:b0:4b8:4703:db8b with SMTP id
5614622812f47-50b5f447760mr9284719b6e.20.1791893634193;
Tue, 13 Oct 2026 05:13:54 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1791893634; cv=none;
d=google.com; s=arc-20260327;
b=pnl/8nMLei35mxlQJm2LySzKRYpfRqeRp/lqfYi5W44jaVLSdm3fGTHwNCCRxMT94m
l9NQF2W1A2ptMzqon8+YtGEfaF2eInWK4+56HTDQ/UX3yG0T1NpKwZMUhxASNHY4AEzy
XhFTAKd6Y8zplZva1FAv5p2TFBco72S3AFesEbU7cIzNqnOLf2fphXARfx+jt4NKCnIm
rNbJfc6yNzqXvTGywfyc8I6qb2VPzxdsL7B9YS9Te09VhmlvL8WSMMZzRvxbnF7NiBXu
/fxdToOuxnotT7yGUAvydqSVlUQ4R4hfN9ZCPr2XXQFsHVJ42I9i5UQn1RurUVzJt+k3
TJTw==
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=KRS+MzphB6cUWBAlor+RAje4hhtl2biqtRGeRYTOtto=;
fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=;
b=JOhbZB0nD7Z49b7f4uuN6KgRLGbkbJaaehTbKzh/ztZxKfJWg7xTYoPo5o0f+muZqJ
Xiq1qSZhcmtbHt11vtyIMmU5L9NKJTCanjFjVoWvzaOGVqfQT+mPPTvuvO211ECCbdG5
XjLf+ZaeZv+BNWwHxP0xK6hEPdcWaowpt2m4/h+xfDW2p5BZrWYK2RaZigPgy/wmmqzV
eGYSvY9aVclu+rTdVNKqhC/vi9sXA7/FRyX8qKTijYjSfn/s7cHPuIXpb8ya3r9qi6+A
6rKB2yJJaQd9vOUXInLXLDaSPaTJaR62HoMoIGz62UL0qNADc5B4RhV6TA8cHcw1vonP
jfvg==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b="DZlGie/D";
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=NJApG5gm;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=K1dZUY+s;
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
5614622812f47-50c1959f58dsi16808930b6e.42.2026.10.13.05.13.53
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Tue, 13 Oct 2026 05:13:53 -0700 (PDT)
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="DZlGie/D";
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=NJApG5gm;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=K1dZUY+s;
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-Owner;
bh=KRS+MzphB6cUWBAlor+RAje4hhtl2biqtRGeRYTOtto=; b=DZlGie/DhHjvnnCssAKeHJL+1w
IIBvooZlhWWEskaadAldYWlFAkNBwC94US4Y81HZUAoDEtUkNjfw8dygJD56J67YQbiQ6Rv6EAWhE
ZG3FFXbF20adyH3gDIDD0224qNU0eWk9Orsypfr226E1LTz5RsMWb3j99C+IYq8dr/To=;
Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com)
by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95)
(envelope-from <openvpn-devel-bounces@lists.sourceforge.net>)
id 1xGbO8-0004RJ-Fv;
Tue, 13 Oct 2026 12:13:49 +0000
Received: from [172.30.29.66] (helo=mx.sourceforge.net)
by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95)
(envelope-from <gert@blue4.greenie.muc.de>) id 1xGbO6-0004RC-Mg
for openvpn-devel@lists.sourceforge.net;
Tue, 13 Oct 2026 12:13:47 +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-Subscribe:List-Post:List-Owner:List-Archive;
bh=YcLJFZq/N+9wNoRyXohzLqHFMPucdoq3Y/CiWCHR1fk=; b=NJApG5gmfyMlpD1qN1/+HYbYhn
ZG5z0FusEpk3JPfjsZvq7Xd/mx6qm5ZrDvsuefKcHrXqrv/Kmn2POe4eOEL/m0VKSzbVZV/8M6XGI
Fs1w2JC1ltJJg6Pbub8o72p2c3xBM1iXZFe16/d0LreYlUmViOQkKlnfup5UI1SGsfPE=;
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-Subscribe:
List-Post:List-Owner:List-Archive;
bh=YcLJFZq/N+9wNoRyXohzLqHFMPucdoq3Y/CiWCHR1fk=; b=K1dZUY+sG6GDVHbpcto4J3xG7q
mC0nx/nxe4+B/bUKulDX9FfI7AJxYkHyKZimQq1ysK0G7QFEOJ+GwN+W/AoUXN/sERcGlZVg5rAJV
FOnwlJAXr+zCKxyRm5MqjKzXk0b6DdgpJ+zaFN9Ot2hb2dndxN/xXkXpxF107nuQ0ERQ=;
Received: from [193.149.48.129] (helo=blue.greenie.muc.de)
by sfi-mx-2.v28.lw.sourceforge.com with esmtps
(TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95)
id 1xGbO5-00062r-HQ for openvpn-devel@lists.sourceforge.net;
Tue, 13 Oct 2026 12:13:47 +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 69DCDcFB027966
for <openvpn-devel@lists.sourceforge.net>; Tue, 13 Oct 2026 14:13:38 +0200
Received: (from gert@localhost)
by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 69DCDcBH027965
for openvpn-devel@lists.sourceforge.net; Tue, 13 Oct 2026 14:13:38 +0200
From: Gert Doering <gert@greenie.muc.de>
To: openvpn-devel@lists.sourceforge.net
Date: Tue, 13 Oct 2026 14:13:31 +0200
Message-ID: <20261013121338.27882-1-gert@greenie.muc.de>
X-Mailer: git-send-email 2.55.0
In-Reply-To:
<gerrit.1791892996000.Ie4a7e0702a30d2a637c3dfe03f6c62d8a9901aae@gerrit.openvpn.net>
References:
<gerrit.1791892996000.Ie4a7e0702a30d2a637c3dfe03f6c62d8a9901aae@gerrit.openvpn.net>
MIME-Version: 1.0
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software,
running on the system "sfi-spamd-2.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: Marco Baffo <marco@mandelbit.com> 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 <marco@mandelbit.com> Acked-by: Razvan Cojocaru
<razvanc@mailbox.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+ [...]
Content analysis details: (1.3 points, 5.0 required)
pts rule name description
---- ----------------------
--------------------------------------------------
0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL
was blocked. See
http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block
for more information. [193.149.48.129 listed in list.dnswl.org]
1.3 RDNS_NONE Delivered to internal network by a host with no rDNS
X-Headers-End: 1xGbO5-00062r-HQ
Subject: [Openvpn-devel] [PATCH v1] PUSH_UPDATE server: free temporary
options after sending message
X-BeenThere: openvpn-devel@lists.sourceforge.net
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <openvpn-devel.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive:
<http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel>
List-Post: <mailto:openvpn-devel@lists.sourceforge.net>
List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: openvpn-devel-bounces@lists.sourceforge.net
X-getmail-retrieved-from-mailbox: Inbox
X-GMAIL-THRID: 1878936659376746509
X-GMAIL-MSGID: 1878936659376746509
|
| Series |
[Openvpn-devel,v1] PUSH_UPDATE server: free temporary options after sending message
|
|
Commit Message
Gert Doering
Oct. 13, 2026, 12:13 p.m. UTC
From: Marco Baffo <marco@mandelbit.com> 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 <marco@mandelbit.com> Acked-by: Razvan Cojocaru <razvanc@mailbox.org> 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 <razvanc@mailbox.org>
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) {