]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemumonitorjsontes: Properly free blockstats
authorPeter Krempa <pkrempa@redhat.com>
Tue, 21 Oct 2025 16:22:15 +0000 (18:22 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 21 Oct 2025 16:29:08 +0000 (18:29 +0200)
In the patch converting block stats to objects in 58aa005f3e9 I forgot
to change the allocation of the hash table in qemumonitorjsontest which
doesn't use the wrapper. This problem didn't manifest itself with newer
glib versions.

Use 'g_object_unref' instead of 'g_free'.

Fixes: 58aa005f3e9
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
tests/qemumonitorjsontest.c

index a229a89860419f81e8fcb8e193b986a744799217..6129dde449aff82a74daa254edb8ae8276faa324 100644 (file)
@@ -1446,7 +1446,7 @@ testQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInfo(const void *opaque)
 {
     const testGenericData *data = opaque;
     virDomainXMLOption *xmlopt = data->xmlopt;
-    g_autoptr(GHashTable) blockstats = virHashNew(g_free);
+    g_autoptr(GHashTable) blockstats = virHashNew(g_object_unref);
     qemuBlockStats *stats;
     g_autoptr(qemuMonitorTest) test = NULL;