This function clears out and frees a virDomainZPCIAddressIds object,
so that's that's what it should take as its argument, *not* the
pointer to a parent object that contains the object we want to free.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
static void
-virDomainPCIAddressSetExtensionFree(virDomainPCIAddressSetPtr addrs)
+virDomainPCIAddressSetExtensionFree(virDomainZPCIAddressIdsPtr zpciIds)
{
- if (!addrs || !addrs->zpciIds)
+ if (!zpciIds)
return;
- g_clear_pointer(&addrs->zpciIds->uids, g_hash_table_unref);
- g_clear_pointer(&addrs->zpciIds->fids, g_hash_table_unref);
+ g_clear_pointer(&zpciIds->uids, g_hash_table_unref);
+ g_clear_pointer(&zpciIds->fids, g_hash_table_unref);
- VIR_FREE(addrs->zpciIds);
+ VIR_FREE(zpciIds);
}
if (!addrs)
return;
- virDomainPCIAddressSetExtensionFree(addrs);
+ virDomainPCIAddressSetExtensionFree(addrs->zpciIds);
VIR_FREE(addrs->buses);
VIR_FREE(addrs);
}