From patchwork Thu Sep 1 14:29:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Moats X-Patchwork-Id: 664939 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3sQ4QT1Csyz9sDG for ; Fri, 2 Sep 2016 00:29:36 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id AF8BB10A71; Thu, 1 Sep 2016 07:29:33 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 9C53910A70 for ; Thu, 1 Sep 2016 07:29:31 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id 44696420177 for ; Thu, 1 Sep 2016 08:29:30 -0600 (MDT) X-ASG-Debug-ID: 1472740169-09eadd335518b8c0001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar5.cudamail.com with ESMTP id S4Ha8WbLmMZ1Iw6K (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 01 Sep 2016 08:29:29 -0600 (MDT) X-Barracuda-Envelope-From: ryanmoats@ryans-macbook-pro-4.local X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO fed1rmfepo101.cox.net) (68.230.241.143) by mx1-pf2.cudamail.com with SMTP; 1 Sep 2016 14:29:29 -0000 Received-SPF: none (mx1-pf2.cudamail.com: domain at ryans-macbook-pro-4.local does not designate permitted sender hosts) X-Barracuda-Apparent-Source-IP: 68.230.241.143 X-Barracuda-RBL-IP: 68.230.241.143 Received: from fed1rmimpo306.cox.net ([68.230.241.174]) by fed1rmfepo101.cox.net (InterMail vM.8.01.05.28 201-2260-151-171-20160122) with ESMTP id <20160901142928.KIQY25338.fed1rmfepo101.cox.net@fed1rmimpo306.cox.net> for ; Thu, 1 Sep 2016 10:29:28 -0400 Received: from Ryans-MacBook-Pro-4.local ([68.13.3.105]) by fed1rmimpo306.cox.net with cox id eEVU1t0042FwX1Q01EVUNE; Thu, 01 Sep 2016 10:29:28 -0400 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A090203.57C83B48.00EF, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.1 cv=eYmdB+wH c=1 sm=1 tr=0 a=dOnThDWq1HkKqEbmY+uBSw==:117 a=dOnThDWq1HkKqEbmY+uBSw==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=GW1xBdLrtEIA:10 a=VnNF1IyMAAAA:8 a=SyqEnQtbarpYkK2Nc5cA:9 a=skCgnbhlp52w9zbo2JeP:22 X-CM-Score: 0.00 Authentication-Results: cox.net; none Received: by Ryans-MacBook-Pro-4.local (Postfix, from userid 501) id 486DF6DAD26; Thu, 1 Sep 2016 09:29:26 -0500 (CDT) X-CudaMail-Envelope-Sender: ryanmoats@ryans-macbook-pro-4.local From: Ryan Moats To: dev@openvswitch.org X-CudaMail-MID: CM-E2-831024804 X-CudaMail-DTE: 090116 X-CudaMail-Originating-IP: 68.230.241.143 Date: Thu, 1 Sep 2016 09:29:24 -0500 X-ASG-Orig-Subj: [##CM-E2-831024804##][PATCH] Fix leak in patched_datapaths processing. Message-Id: <1472740164-16503-1-git-send-email-rmoats@us.ibm.com> X-Mailer: git-send-email 2.7.4 (Apple Git-66) X-GBUdb-Analysis: 0, 68.230.241.143, Ugly c=0.237282 p=-0.4 Source Normal X-MessageSniffer-Rules: 0-0-0-3464-c X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1472740169 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.32529 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Subject: [ovs-dev] [PATCH] Fix leak in patched_datapaths processing. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" When unpersisting patch_datapaths, missed that the key field needed to be freed to avoid a memory leak. This patch fixes same. Signed-off-by: Ryan Moats Acked-by: Flavio Fernandes --- ovn/controller/ovn-controller.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c index c2e667b..c4f02bc 100644 --- a/ovn/controller/ovn-controller.c +++ b/ovn/controller/ovn-controller.c @@ -477,6 +477,7 @@ main(int argc, char *argv[]) HMAP_FOR_EACH_SAFE (pd_cur_node, pd_next_node, hmap_node, &patched_datapaths) { hmap_remove(&patched_datapaths, &pd_cur_node->hmap_node); + free(pd_cur_node->key); free(pd_cur_node); } hmap_destroy(&patched_datapaths);