[dpdk-dev] [PATCH 3/6] test: fix memory leak in ring autotest

Olivier MATZ olivier.matz at 6wind.com
Fri Dec 22 17:26:43 CET 2017


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.


More information about the dev mailing list