[PATCH] virNWFilterIncludeDefToRuleInst: Prevent potential double g_free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.fedin@xxxxxxxxxxx>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@xxxxxxxxxxxx>
---
 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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux