]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: free the ports array of a USB hub
authorJán Tomko <jtomko@redhat.com>
Mon, 15 Aug 2016 15:21:32 +0000 (17:21 +0200)
committerJán Tomko <jtomko@redhat.com>
Tue, 16 Aug 2016 10:31:41 +0000 (12:31 +0200)
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

index c533edb4ff6e08d7420f8786a91f57552ad9dbb6..c9cddaca7be8ce2e123fed55bfc15a437fbc336e 100644 (file)
@@ -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);
 }