From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH 3/6] test: fix memory leak in ring autotest Date: Fri, 22 Dec 2017 17:26:43 +0100 Message-ID: <20171222162642.brpmnqhtovmlwxe2@platinum> References: <9d5a3bc7a779b2dddab4256aa3e0631737861f98.1513867589.git.anatoly.burakov@intel.com> <5dee0afeaa0d007dfc9d949b1975c97537585ca4.1513867589.git.anatoly.burakov@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, stable@dpdk.org To: Anatoly Burakov Return-path: Content-Disposition: inline In-Reply-To: <5dee0afeaa0d007dfc9d949b1975c97537585ca4.1513867589.git.anatoly.burakov@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, On Fri, Dec 22, 2017 at 10:12:07AM +0000, Anatoly Burakov wrote: > Fixes: af75078fece3 ("first public release") Not sure about this commit id: freeing rings is only possible since commit 4e32101f9b01 ("ring: support freeing"). [...] > @@ -894,6 +895,8 @@ test_ring(void) > /* dump the ring status */ > rte_ring_list_dump(stdout); > > + rte_ring_free(r); > + > return 0; I think this is incorrect: r is a static variable, and if it is not set to NULL, it will be reused at next call. Ideally, removing the static variable would be better than just resetting the value to NULL, but it will require more modifications: add a ring argument to test function, and change return -1 -> goto fail.