[libvirt PATCH v2 08/15] nwfilter: remove unnecessary code from ebtablesGetSubChainInsts()

Ján Tomko jtomko at redhat.com
Wed Jul 15 15:30:35 UTC 2020


On a Tuesday in 2020, Laine Stump wrote:
>On failure, this function would clear out and free the list of
>subchains it had been called with. This is unnecessary, because the
>*only* caller of this function will also clear out and free the list
>of subchains if it gets a failure from ebtablesGetSubChainInsts().
>
>(It also makes more logical sense for the function that is creating
>the entire list to be the one freeing the entire list, rather than
>having a function whose purpose is only to create *one item* on the
>list freeing the entire list).

This is the function creating the list, I think it makes sense
to not leave anything allocated in case of failure.

Jano

>
>Signed-off-by: Laine Stump <laine at redhat.com>
>---
> src/nwfilter/nwfilter_ebiptables_driver.c | 6 ------
> 1 file changed, 6 deletions(-)
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200715/2af52d2a/attachment-0001.sig>


More information about the libvir-list mailing list