On Tue, Apr 16, 2024 at 02:34:23PM +0200, Andrey Albershteyn wrote: > + if (!count) { > + flist_free(fl); > continue; > + } This looks good. The more obvious way would be move the whole loop body into a helper with two clear exits, one that returns fl, and one that frees it and returns NULL..