[PATCH 6/6] conf: fix memleak in virDomainHostdevDefClear

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

 



use virNetworkRouteDefFree() instead of VIR_FREE to free routes, otherwise
the element 'family' would not be freed.

Signed-off-by: Zhang Bo <oscar.zhangbo@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 8350fe7..f383104 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1881,7 +1881,7 @@ void virDomainHostdevDefClear(virDomainHostdevDefPtr def)
                 VIR_FREE(def->source.caps.u.net.ips[i]);
             VIR_FREE(def->source.caps.u.net.ips);
             for (i = 0; i < def->source.caps.u.net.nroutes; i++)
-                VIR_FREE(def->source.caps.u.net.routes[i]);
+                virNetworkRouteDefFree(def->source.caps.u.net.routes[i]);
             VIR_FREE(def->source.caps.u.net.routes);
             break;
         }
-- 
1.7.12.4


--
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]