From: Tim Wiederhake Date: Mon, 5 Jul 2021 14:36:01 +0000 (+0200) Subject: testQemuMonitorJSONqemuMonitorJSONGetBlockInfo: `virHashNew` cannot return NULL X-Git-Tag: v7.6.0-rc1~191 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=091f22223b02a016c89b3f501390dff8492f0019;p=thirdparty%2Flibvirt.git testQemuMonitorJSONqemuMonitorJSONGetBlockInfo: `virHashNew` cannot return NULL Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 7fd58dc2d1..89ede3b59a 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1460,18 +1460,14 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockInfo(const void *opaque) { const testGenericData *data = opaque; virDomainXMLOption *xmlopt = data->xmlopt; - g_autoptr(GHashTable) blockDevices = NULL; - g_autoptr(GHashTable) expectedBlockDevices = NULL; + g_autoptr(GHashTable) blockDevices = virHashNew(g_free); + g_autoptr(GHashTable) expectedBlockDevices = virHashNew(g_free); struct qemuDomainDiskInfo *info; g_autoptr(qemuMonitorTest) test = NULL; if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema))) return -1; - if (!(blockDevices = virHashNew(g_free)) || - !(expectedBlockDevices = virHashNew(g_free))) - return -1; - info = g_new0(struct qemuDomainDiskInfo, 1); if (virHashAddEntry(expectedBlockDevices, "virtio-disk0", info) < 0) {