[libvirt] [PATCH 1/2] conf: free the ports array of a USB hub

Ján Tomko jtomko at redhat.com
Mon Aug 15 16:14:26 UTC 2016


The array needs to be freed too, not just its members.

https://bugzilla.redhat.com/show_bug.cgi?id=1366097
---
 src/conf/domain_addr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index c533edb..c9cddac 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -1360,6 +1360,7 @@ virDomainUSBAddressHubFree(virDomainUSBAddressHubPtr hub)
 
     for (i = 0; i < hub->nports; i++)
         virDomainUSBAddressHubFree(hub->ports[i]);
+    VIR_FREE(hub->ports);
     virBitmapFree(hub->portmap);
     VIR_FREE(hub);
 }
-- 
2.7.3




More information about the libvir-list mailing list