From patchwork Wed Nov 11 16:37:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5671 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:529c:b0:11a:a05e:cb97 with SMTP id x28csp725747lax; Wed, 11 Nov 2026 08:37:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErF7o95cf3tGP9Rsg/ayzKiL5Kh3vBQxT0L0jWN8HJRgQRlZNn1udtmnR+7ic6oE4hmp1kKfAXwAZO4=@openvpn.net X-Received: by 2002:a05:7023:a4c:b0:1b2:6d3f:6305 with SMTP id a92af1059eb24-1b3c023d80dmr2746569c88.1.1794415052779; Wed, 11 Nov 2026 08:37:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794415052; cv=none; d=google.com; s=arc-20260327; b=IfKZtaM2pKK/d9OQFIIGZ45YGOGhyxqqqeLlteA6MllcDOAFeoqlHURq/6ZOU6Lq+G u1855ceUCeKoyiqhPfOqh2X5l+qn0KNB2Zge1EaHkTj46DzxeOSHNiVKU1yCV03nAgH+ Y+86o+3Iud9O37ZhnRZNMALq0uOcKd3X/x8vrGrXc95Xd7B75A2hTRDNRPc0GSVP/Vyd 15vDudkaLELaWKVnoJ2wKxOCT98rLC3Yjmxd8hCBBxyujD9r7YgaJ4hfDRNn5zEPqfri M454nByxgPhZwTt59YLyMibWarwBl3z3xvXxwZFcX/s2cTp+oUV88wbg0/aMjl1HhTXT /qxA== 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=c+0XL76D1VFh868qEAlr/jYbAzVfMBHud/j7OfoDmAM=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=C5N2PzjAoYT+kebeAASGLAVfjM49KK1TNmjsp8QDal0BVZGwToTtg/q+MG6jRcP5CO 7IU0JnAZgDjEwJXwpd5C/VQsPa3Acr+PgoZHOW2JdEWwUGsifvG9SFJLMLA3OwbguvAR FRYhbiClGnXNiCBEXSt2phKD5IMrzyTKKrfRGBdJEaS3cEhNcuECvZOATMJbEPbtunkb QRO2GMJLhvDz6yUcUSljx/2Fe69MrEi9Hsq/KLH58o3P/8awBKCBEru9OK1WnqKvV2JL HzkIVecBiTsfoe1si1s5N40BGQBMu1IdQGBDcT9JkCUrISUzL4UmfzheTH+CZlLpG/IZ Arwg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=ZdEr075W; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=SyworBWW; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=kfn9uysO; 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 a92af1059eb24-1b3b5b5b3d2si14405598c88.24.2026.11.11.08.37.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Nov 2026 08:37:32 -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=ZdEr075W; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=SyworBWW; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=kfn9uysO; 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=c+0XL76D1VFh868qEAlr/jYbAzVfMBHud/j7OfoDmAM=; b=ZdEr075W006sEF 6biHl25jk3P20CEraIL9UHtIpe+IuMCZNr3qEtoThDc+1WTxv/rzkC2G5qWoff8nxlMtxZVptgKO9 KL5CTL+lG0v4Ym0vnFHwmztD2VSMxdFhR+CRjN/YjVWAP7PUDPWs06pp1KI1QCo+cc7Dal8JPef5X k3I=; 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 1xRBKB-000000003Vk-2g7q; Wed, 11 Nov 2026 16:37:27 +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 1xRBKA-000000003Vb-2orx for openvpn-devel@lists.sourceforge.net; Wed, 11 Nov 2026 16:37:26 +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=Bewf/FKfxT/UTonWZdv4m72eSty1R5smN4Mfw6XpTEI=; b=SyworBWWKjBwnOrHnqspScoRlC PjJZfbbdFjb9ZYExGGp/adIBBDpBciKb1v3B/ZqfmQuaGpMvWGf74H9jjz33DBljft0SIdxfLtt35 DeyanEdYsMrl7Ci9WEIH2pQtX0xNAcKA7Bn5nauKUcEPpMMZ6GTbH5cHZVpHODQKc/7k=; 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=Bewf/FKfxT/UTonWZdv4m72eSty1R5smN4Mfw6XpTEI=; b=kfn9uysOOF2+BqYJto0qKxRH60 6BN3xQW07Wi48R/AUCZP0Q4FdOdkexYhlFDkqWp4aJinlJUL1y46WGauzm3rMhos3E/V8rxajgJb1 iOqRPQFavyMfP4wA+OkhXjL9igQRTmXQu3B/4UGsDz3CYMCA2pHdSOkrDfyvm/5axkTM=; 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 1xRBK8-000000002Y8-2AMR for openvpn-devel@lists.sourceforge.net; Wed, 11 Nov 2026 16:37:26 +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 6ABGbH6X006385 for ; Wed, 11 Nov 2026 17:37:17 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6ABGbHm2006384 for openvpn-devel@lists.sourceforge.net; Wed, 11 Nov 2026 17:37:17 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 11 Nov 2026 17:37:09 +0100 Message-ID: <20261111163717.6369-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 The domains string was only freed when the search list key could be opened. Free it unconditionally, as the caller frees the undo data right after. Broken since ae90cbad ("dns: support multiple domains without DHCP"). 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: 1xRBK8-000000002Y8-2AMR Subject: [Openvpn-devel] [PATCH v1] openvpnserv: always free the domains in UndoDnsSearchDomains() 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: 1881580558183064957 X-GMAIL-MSGID: 1881580558183064957 From: Razvan Cojocaru The domains string was only freed when the search list key could be opened. Free it unconditionally, as the caller frees the undo data right after. Broken since ae90cbad ("dns: support multiple domains without DHCP"). Change-Id: Idf378bb5af0b2b4e8d746e252159b756e96c37fb Signed-off-by: Razvan Cojocaru Acked-by: Antonio Quartulli Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2160 --- 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/+/2160 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Antonio Quartulli diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index 81205d6..710a797 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -1754,10 +1754,10 @@ RemoveDnsSearchDomains(dns_searchlist_key, undo_data->domains); RegCloseKey(dns_searchlist_key); ApplyDnsSettings(gpol); - - free(undo_data->domains); - undo_data->domains = NULL; } + + free(undo_data->domains); + undo_data->domains = NULL; } /**