]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: fix arg to virDomainPCIAddressSetExtensionFree()
authorLaine Stump <laine@redhat.com>
Sat, 30 Jan 2021 19:02:28 +0000 (14:02 -0500)
committerLaine Stump <laine@redhat.com>
Tue, 2 Feb 2021 05:27:58 +0000 (00:27 -0500)
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>
src/conf/domain_addr.c

index 37dad20adee9029570f6b7f9aa12cbfa43316367..0539efbad1b88ac548d6a20f8c66d422e26f7be6 100644 (file)
@@ -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);
 }