From: Laine Stump Date: Sat, 30 Jan 2021 19:02:28 +0000 (-0500) Subject: conf: fix arg to virDomainPCIAddressSetExtensionFree() X-Git-Tag: v7.1.0-rc1~381 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb8f62ce88fce0f9f2c46c4d2ffb0b56f7cb533d;p=thirdparty%2Flibvirt.git conf: fix arg to virDomainPCIAddressSetExtensionFree() 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 Reviewed-by: Michal Privoznik --- diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 37dad20ade..0539efbad1 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -944,15 +944,15 @@ virDomainPCIAddressReleaseAddr(virDomainPCIAddressSetPtr addrs, 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); } @@ -1001,7 +1001,7 @@ virDomainPCIAddressSetFree(virDomainPCIAddressSetPtr addrs) if (!addrs) return; - virDomainPCIAddressSetExtensionFree(addrs); + virDomainPCIAddressSetExtensionFree(addrs->zpciIds); VIR_FREE(addrs->buses); VIR_FREE(addrs); }