Re: [PATCH] netlink: fix memory leak
From: Florian Westphal
Date: Sun Jul 22 2018 - 04:13:17 EST
Jason A. Donenfeld <Jason@xxxxxxxxx> wrote:
> On Sun, Jul 22, 2018 at 4:51 AM Shaochun Chen <cscnull@xxxxxxxxx> wrote:
> But even if you moved it somehow to the if(ret), I'm still not sure
> it'd be correct; start cbs should either succeed, or they should error
> out and cleanup entirely after themselves.
I agree, ->done() should not be called if cb->dump() was never invoked.
All ctnetlink and nf_tables spots need to cleanup after themselves.