| Message ID | 1535550583-21825-1-git-send-email-steffan.karger@fox-it.com |
|---|---|
| State | Accepted |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net> Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net (Dovecot) with LMTP id +477BM+khltnHAAAIUCqbw for <patchwork@openvpn.net>; Wed, 29 Aug 2018 09:51:11 -0400 Received: from proxy8.mail.ord1d.rsapps.net ([172.30.191.6]) by director9.mail.ord1d.rsapps.net with LMTP id sFnxBM+khlttAwAAalYnBA ; Wed, 29 Aug 2018 09:51:11 -0400 Received: from smtp33.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy8.mail.ord1d.rsapps.net with LMTP id OHNzBM+khlv+eAAAGdz6CA ; Wed, 29 Aug 2018 09:51:11 -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: smtp33.gate.ord1d.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; dmarc=none (p=nil; dis=none) header.from=fox-it.com X-Suspicious-Flag: YES X-Classification-ID: 95c3a84e-ab92-11e8-9646-525400041ef2-1-1 Received: from [216.105.38.7] ([216.105.38.7:46958] helo=lists.sourceforge.net) by smtp33.gate.ord1d.rsapps.net (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id EA/AD-06674-EC4A68B5; Wed, 29 Aug 2018 09:51:10 -0400 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) id 1fv0rU-0004qI-5b; Wed, 29 Aug 2018 13:50:20 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from <steffan.karger@fox-it.com>) id 1fv0rT-0004qC-7Z for openvpn-devel@lists.sourceforge.net; Wed, 29 Aug 2018 13:50:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:MIME-Version:Message-ID:Date:Subject: CC:To:From:Sender:Reply-To: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=T6j03csTfgR6tb+mGATXe/VCZDkEJCk44Ya3OwAbGBE=; b=TbR57cmhXRYkSHw40KB9hp7Lou cRmZ78j/qehratUkkZWR3kn4gi3qHxTJ5gP29j3vHADE2yPG0ZGH3xd13O84y8ibX7Uqo1PCWP73V xANNysd38X6qiSEu8DHXghjvu5zGg3igVlmh3conetQeb6lBwhejGhj+2yL/lUraVVZE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From:Sender: Reply-To: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=T6j03csTfgR6tb+mGATXe/VCZDkEJCk44Ya3OwAbGBE=; b=W TpZenAaJavt7bh1rF6ueGM35/14grVOLDveU6kADpQ5641I2mK7pu9e2v7vsunTP1iaOvckk3Dowp eHLkwhhIpEFDMJjEJm1vlPuHWhxChOpWxGf3SK3MoIXcYW3AbSNds7IToS1K/0H7ReqGZvxTBbLQG tqhmeb7sgbaYj49Q=; Received: from ns2.fox-it.com ([178.250.144.131]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1:ECDHE-RSA-AES256-SHA:256) (Exim 4.90_1) id 1fv0rR-0024pe-PP for openvpn-devel@lists.sourceforge.net; Wed, 29 Aug 2018 13:50:19 +0000 Received: from FOXDFT52.FOX.local (unknown [10.0.0.129]) by ns2.fox-it.com (Postfix) with ESMTPS id 88B401AF889 for <openvpn-devel@lists.sourceforge.net>; Wed, 29 Aug 2018 15:50:10 +0200 (CEST) Received: from steffan-fox.fox.local (172.16.5.175) by FOXDFT52.FOX.local (10.0.0.129) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Wed, 29 Aug 2018 15:50:10 +0200 From: Steffan Karger <steffan.karger@fox-it.com> To: <openvpn-devel@lists.sourceforge.net> Date: Wed, 29 Aug 2018 15:49:43 +0200 Message-ID: <1535550583-21825-1-git-send-email-steffan.karger@fox-it.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-ClientProxiedBy: FOXDFT52.FOX.local (10.0.0.129) To FOXDFT52.FOX.local (10.0.0.129) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1fv0rR-0024pe-PP Subject: [Openvpn-devel] [PATCH] Fix memory leak after sighup 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 |
| Series |
[Openvpn-devel] Fix memory leak after sighup
|
|
Commit Message
Steffan Karger
Aug. 29, 2018, 3:49 a.m. UTC
The c.es env_set is (re)allocated for each "sighup loop iteration", while
it was free'd only once at process shutdown. Move the env_set_destroy()
call to match the same level as the env_set_create() call to fix that.
Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
---
src/openvpn/openvpn.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
Am 29.08.18 um 15:49 schrieb Steffan Karger: > The c.es env_set is (re)allocated for each "sighup loop iteration", while > it was free'd only once at process shutdown. Move the env_set_destroy() > call to match the same level as the env_set_create() call to fix that. > Acked-by: Arne Schwabe <arne@rfc2549.org> This like the right fix and even though the leak is small we should fix it nevertheless. Arne ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Your patch has been applied to the master and release/2.4 branch (bugfix).
commit 7170bef507bfe74ceb4a12f8f10df4d2d6ad39c9 (master)
commit 8fcfe1d449a64e1ce61e361dc593ff52293b41f2 (release/2.4)
Author: Steffan Karger
Date: Wed Aug 29 15:49:43 2018 +0200
Fix memory leak after sighup
Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1535550583-21825-1-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg17429.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
--
kind regards,
Gert Doering
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
diff --git a/src/openvpn/openvpn.c b/src/openvpn/openvpn.c index b9e914a..3819889 100644 --- a/src/openvpn/openvpn.c +++ b/src/openvpn/openvpn.c @@ -329,6 +329,7 @@ openvpn_main(int argc, char *argv[]) } while (c.sig->signal_received == SIGUSR1); + env_set_destroy(c.es); uninit_options(&c.options); gc_reset(&c.gc); } @@ -337,8 +338,6 @@ openvpn_main(int argc, char *argv[]) context_gc_free(&c); - env_set_destroy(c.es); - #ifdef ENABLE_MANAGEMENT /* close management interface */ close_management();