From patchwork Fri Sep 9 12:36:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Moats X-Patchwork-Id: 668002 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 3sVxXp3RNZz9ryr for ; Fri, 9 Sep 2016 22:36:57 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 9EFAF10636; Fri, 9 Sep 2016 05:36:55 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id B05C110630 for ; Fri, 9 Sep 2016 05:36:53 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 176741E02C6 for ; Fri, 9 Sep 2016 06:36:53 -0600 (MDT) X-ASG-Debug-ID: 1473424612-09eadd44f256700001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar5.cudamail.com with ESMTP id jqglEyF2I3jv8cOi (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 09 Sep 2016 06:36:52 -0600 (MDT) X-Barracuda-Envelope-From: ryanmoats@ryans-macbook-pro-4.local X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO fed1rmfepo201.cox.net) (68.230.241.146) by mx1-pf1.cudamail.com with SMTP; 9 Sep 2016 12:36:52 -0000 Received-SPF: none (mx1-pf1.cudamail.com: domain at ryans-macbook-pro-4.local does not designate permitted sender hosts) X-Barracuda-Apparent-Source-IP: 68.230.241.146 X-Barracuda-RBL-IP: 68.230.241.146 Received: from fed1rmimpo110.cox.net ([68.230.241.159]) by fed1rmfepo201.cox.net (InterMail vM.8.01.05.28 201-2260-151-171-20160122) with ESMTP id <20160909123651.ORKX18419.fed1rmfepo201.cox.net@fed1rmimpo110.cox.net> for ; Fri, 9 Sep 2016 08:36:51 -0400 Received: from Ryans-MacBook-Pro-4.local ([68.13.3.105]) by fed1rmimpo110.cox.net with cox id hQcq1t00J2FwX1Q01QcrU9; Fri, 09 Sep 2016 08:36:51 -0400 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A090206.57D2ACE3.0049, 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=ZOV34SPb 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=IqL9KstSDwtH3GP50LMA: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 DEBE16FEE00; Fri, 9 Sep 2016 07:36:49 -0500 (CDT) X-CudaMail-Envelope-Sender: ryanmoats@ryans-macbook-pro-4.local From: Ryan Moats To: dev@openvswitch.org X-CudaMail-MID: CM-E1-908011587 X-CudaMail-DTE: 090916 X-CudaMail-Originating-IP: 68.230.241.146 Date: Fri, 9 Sep 2016 07:36:47 -0500 X-ASG-Orig-Subj: [##CM-E1-908011587##][PATCH] ovn-nbctl, tests: Clean up noisy memory leaks Message-Id: <1473424607-29288-1-git-send-email-rmoats@us.ibm.com> X-Mailer: git-send-email 2.7.0 X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1473424612 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 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.32759 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] ovn-nbctl, tests: Clean up noisy memory leaks 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 run with valgrind, ovn-nbctl.c and tests/test-ovn.c reveal memory leaks of their own. This patch cleans these up so that they don't create noise when looking for leaks in the OVN daemon processes. Signed-off-by: Ryan Moats --- ovn/utilities/ovn-nbctl.c | 1 + tests/test-ovn.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index d6d64ea..a37fe51 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -1608,6 +1608,7 @@ nbctl_lr_route_add(struct ctl_context *ctx) } if (!may_exist) { + free(rt_prefix); ctl_fatal("duplicate prefix: %s", prefix); } diff --git a/tests/test-ovn.c b/tests/test-ovn.c index 0ef09ab..8e9aa15 100644 --- a/tests/test-ovn.c +++ b/tests/test-ovn.c @@ -328,6 +328,7 @@ test_dump_symtab(struct ovs_cmdl_context *ctx OVS_UNUSED) ds_destroy(&s); } + free(nodes); expr_symtab_destroy(&symtab); shash_destroy(&symtab); } @@ -1227,6 +1228,8 @@ test_parse_actions(struct ovs_cmdl_context *ctx OVS_UNUSED) } expr_destroy(prereqs2); + ovnacts_free(ovnacts2.data, ovnacts2.size); + ofpbuf_uninit(&ovnacts2); ds_destroy(&ovnacts_s); } else { printf(" %s\n", error); @@ -1234,6 +1237,7 @@ test_parse_actions(struct ovs_cmdl_context *ctx OVS_UNUSED) } expr_destroy(prereqs); + ovnacts_free(ovnacts.data, ovnacts.size); ofpbuf_uninit(&ovnacts); } ds_destroy(&input);