mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
qemuMonitorJSONGetAllBlockJobInfo: Use automatic memory management
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
12ee3b35c6
commit
5b7e88322d
@ -5069,12 +5069,12 @@ GHashTable *
|
|||||||
qemuMonitorJSONGetAllBlockJobInfo(qemuMonitor *mon,
|
qemuMonitorJSONGetAllBlockJobInfo(qemuMonitor *mon,
|
||||||
bool rawjobname)
|
bool rawjobname)
|
||||||
{
|
{
|
||||||
virJSONValue *cmd = NULL;
|
g_autoptr(virJSONValue) cmd = NULL;
|
||||||
virJSONValue *reply = NULL;
|
g_autoptr(virJSONValue) reply = NULL;
|
||||||
virJSONValue *data;
|
virJSONValue *data;
|
||||||
size_t nr_results;
|
size_t nr_results;
|
||||||
size_t i;
|
size_t i;
|
||||||
GHashTable *blockJobs = NULL;
|
g_autoptr(GHashTable) blockJobs = NULL;
|
||||||
|
|
||||||
cmd = qemuMonitorJSONMakeCommand("query-block-jobs", NULL);
|
cmd = qemuMonitorJSONMakeCommand("query-block-jobs", NULL);
|
||||||
if (!cmd)
|
if (!cmd)
|
||||||
@ -5103,14 +5103,10 @@ qemuMonitorJSONGetAllBlockJobInfo(qemuMonitor *mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virJSONValueFree(cmd);
|
return g_steal_pointer(&blockJobs);
|
||||||
virJSONValueFree(reply);
|
|
||||||
return blockJobs;
|
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virHashFree(blockJobs);
|
return NULL;
|
||||||
blockJobs = NULL;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user