[PATCH] nwfilter: Don't leak @val

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

 



In virNWFilterIPAddrMapAddIPAddr the @val may be leaked.

Signed-off-by: ZhiPeng Lu <lu.zhipeng@xxxxxxxxxx>
---
 src/conf/nwfilter_ipaddrmap.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/conf/nwfilter_ipaddrmap.c b/src/conf/nwfilter_ipaddrmap.c
index 446f3de..5242f05 100644
--- a/src/conf/nwfilter_ipaddrmap.c
+++ b/src/conf/nwfilter_ipaddrmap.c
@@ -61,7 +61,10 @@ virNWFilterIPAddrMapAddIPAddr(const char *ifname, char *addr)
         if (!val)
             goto cleanup;
         ret = virNWFilterHashTablePut(ipAddressMap, ifname, val);
-        goto cleanup;
+	 if (ret < 0) {
+	     virNWFilterVarValueFree(val);
+            goto cleanup;
+	 }
     } else {
         if (virNWFilterVarValueAddValue(val, addr) < 0)
             goto cleanup;
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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