From patchwork Wed Sep 26 09:27:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steffan Karger X-Patchwork-Id: 471 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director11.mail.ord1d.rsapps.net ([172.27.255.56]) by backend30.mail.ord1d.rsapps.net with LMTP id 4DFCKePdq1uDFwAAIUCqbw for ; Wed, 26 Sep 2018 15:28:35 -0400 Received: from proxy19.mail.iad3a.rsapps.net ([172.27.255.56]) by director11.mail.ord1d.rsapps.net with LMTP id sBMBJ+Pdq1vXZAAAvGGmqA ; Wed, 26 Sep 2018 15:28:35 -0400 Received: from smtp4.gate.iad3a ([172.27.255.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy19.mail.iad3a.rsapps.net with LMTP id 2Jq7IePdq1s7BQAAXy6Yeg ; Wed, 26 Sep 2018 15:28:35 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp4.gate.iad3a.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=karger-me.20150623.gappssmtp.com; dmarc=none (p=nil; dis=none) header.from=karger.me X-Suspicious-Flag: YES X-Classification-ID: 5bcfd40a-c1c2-11e8-aa28-5254003c557e-1-1 Received: from [216.105.38.7] ([216.105.38.7:37721] helo=lists.sourceforge.net) by smtp4.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id D6/9B-11655-2EDDBAB5; Wed, 26 Sep 2018 15:28:35 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1g5FT5-0002TH-8v; Wed, 26 Sep 2018 19:27:27 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1g5FT3-0002TB-VU for openvpn-devel@lists.sourceforge.net; Wed, 26 Sep 2018 19:27:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=LuSQLLqn2dRk0E2+mZGJjgSUIRILOjqEG9YV84hQADQ=; b=a/GHSAyQZjhyTmGUBjTSwT1R7X C+rQmZ9Jza4N1T+0rYXFqtyg4yr+8i0/BQvz338eCgU+xCLVazAR7Qmty7DPTl7u2/TUth4QEYrzT uPhFIgWPq6poFEqw7du+6+sMzNjJmq1Z/JcfIhx7bSf4c/wqHFlR8p5//EUcW6HVULtI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=LuSQLLqn2dRk0E2+mZGJjgSUIRILOjqEG9YV84hQADQ=; b=BKnjIsOYSgzBDRC1TGm8DfqLOH VB055zu2rrQk7nlumNw1AWzXvAtJoZ3JbBfDD0WKiHabuHTfCmJv03ZpKCU2K80kS5y8W1BAMUtIn H/T1CY5eGMdA6F/COIKeNxB/cn2GdRZqiT85bG5SZzpq8mcILijN/YgHrzTk2nu3UVnM=; Received: from mail-ed1-f67.google.com ([209.85.208.67]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) id 1g5FT0-0074fz-NG for openvpn-devel@lists.sourceforge.net; Wed, 26 Sep 2018 19:27:25 +0000 Received: by mail-ed1-f67.google.com with SMTP id t11-v6so2896017edq.11 for ; Wed, 26 Sep 2018 12:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=karger-me.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=LuSQLLqn2dRk0E2+mZGJjgSUIRILOjqEG9YV84hQADQ=; b=om+7dkgmGRuhxvOaRRLbwEr79U2sI/Z2eBztvVOlo63q7CqJoDoRhB5b23hhPS+sSW oslgqDaxaebdPd/NhieO4O2pvCNO+wcoDg9tgeIcDnoCs8qCOWaP878aSxQEA4XzDIG2 iaO0LeXtbhr8O6ovxd0ya0gcVC+7YGQZnYLPEU2ZoBoBpael3fV6oVSESPb4c90kEyBd g/b0fZpl/JYQp0CpnXteuxi8pf0RAWwLh6bgHQnCkDk//upfilu/ZFB6bffYeA8QueLU ZgGmdio6qFiDS+DO+WztmOQZBiX+SaGH+V3XedlBot6AUfczGccl5TJrJWnN7/z+HrHe xq7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=LuSQLLqn2dRk0E2+mZGJjgSUIRILOjqEG9YV84hQADQ=; b=PxeJw+9AmKHu4zvB81IQ0qEaxGBjdiPI33pGFL3z7QXGFNOUshtifs07PgxvMboe+V cLbXAolB1ZkdCsqV4sBL/zEjMg9qOEL4lv5jWJB4jn72hAdmbdEO5ImEqymq+7bxMTUI YX+IOdG0rNW7BSBpDoO3jR/KjYqs42ryA4aXpLBvRbE7osgo/9HVtfb24NUMld7rsT4K 3Jp+IaYMhhNoyWJz7Jm3yvahcSAXYP9lkrVANzAaceeAfMNoW9zhTyN0fUEz6uatKPhl FJAMZTk33QK/mycAxL1kNafwzIFMj6OeQzDLV4GhJy/RKHdq3M9KhBGVfC6jULSyp8we n4eg== X-Gm-Message-State: ABuFfoiv3NS3aOmdpo8XQ4twdcsshFb2GEGB8KDus/diV+nlG5t98fct 49+DyR5uIF/MZqgqfh1fNA++qsycQDY= X-Google-Smtp-Source: ACcGV62TKomHICzxSjBymjCib+MBosgL2hx0V2y1du4BpomkkAZUnO4C1Y/hqVCkx2c0nHrNEV/+yg== X-Received: by 2002:a50:8c45:: with SMTP id p63-v6mr12142348edp.84.1537990035903; Wed, 26 Sep 2018 12:27:15 -0700 (PDT) Received: from vesta.fritz.box ([2001:985:e54:1:c172:bb5f:9f61:2a7c]) by smtp.gmail.com with ESMTPSA id m22-v6sm135824edp.0.2018.09.26.12.27.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Sep 2018 12:27:15 -0700 (PDT) From: Steffan Karger To: openvpn-devel@lists.sourceforge.net Date: Wed, 26 Sep 2018 21:27:06 +0200 Message-Id: <20180926192706.29460-1-steffan@karger.me> X-Mailer: git-send-email 2.17.1 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.208.67 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.67 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 DKIMWL_WL_MED DKIMwl.org - Whitelisted Medium sender X-Headers-End: 1g5FT0-0074fz-NG Subject: [Openvpn-devel] [PATCH] Fix memory leak in SSL_CTX_use_certificate 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: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Commit 98bfeeb4 introduced a memory leak in SSL_CTX_use_certificate by removing the "if(x509) { ... }" bit while not changing the "else if(x) {}" right after to an "if(x) {}". Signed-off-by: Steffan Karger Acked-By: Arne Schwabe --- src/openvpn/ssl_openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c index d9bc9d74..fe4db604 100644 --- a/src/openvpn/ssl_openssl.c +++ b/src/openvpn/ssl_openssl.c @@ -855,7 +855,7 @@ end: { BIO_free(in); } - else if (x) + if (x) { X509_free(x); }