[...]
+
+static void
+virDomainUSBAddressHubFree(virDomainUSBAddressHubPtr hub)
+{
+ size_t i;
+
+ if (!hub)
^^^^^^^^
+ return;
+
+ for (i = 0; i < hub->nports; i++) {
+ if (hub->hubs[i])
Of course I realize after pressing send that the if check is duplicitous
+ virDomainUSBAddressHubFree(hub->hubs[i]);
+ }
+ virBitmapFree(hub->ports);
+ VIR_FREE(hub);
+}
+
+
+void
+virDomainUSBAddressSetFree(virDomainUSBAddressSetPtr addrs)
+{
+ size_t i;
+
+ if (!addrs)
+ return;
+
+ for (i = 0; i < addrs->nbuses; i++) {
+ if (addrs->buses[i])
here too...
+ virDomainUSBAddressHubFree(addrs->buses[i]);
+ }
+ VIR_FREE(addrs->buses);
+ VIR_FREE(addrs);
+}
[...]