If virNWFilterDefToInst returns -1, it has already called virNWFilterInstReset. Remove the additional call to prevent a double g_free
Found by Linux Verification Center (linuxtesting.org) with Svace. Reported-by: Dmitry Fedin <d.fe...@fobos-nt.ru> Signed-off-by: Alexander Kuznetsov <kuznetso...@altlinux.org> --- src/nwfilter/nwfilter_gentech_driver.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c index 41f270bb7c..f7a909bdc0 100644 --- a/src/nwfilter/nwfilter_gentech_driver.c +++ b/src/nwfilter/nwfilter_gentech_driver.c @@ -293,10 +293,8 @@ virNWFilterIncludeDefToRuleInst(virNWFilterDriverState *driver, tmpvars, useNewFilter, foundNewFilter, - inst) < 0) { - virNWFilterInstReset(inst); + inst) < 0) return -1; - } return 0; } -- 2.42.4