mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-09 01:04:59 +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,
|
||||
bool rawjobname)
|
||||
{
|
||||
virJSONValue *cmd = NULL;
|
||||
virJSONValue *reply = NULL;
|
||||
g_autoptr(virJSONValue) cmd = NULL;
|
||||
g_autoptr(virJSONValue) reply = NULL;
|
||||
virJSONValue *data;
|
||||
size_t nr_results;
|
||||
size_t i;
|
||||
GHashTable *blockJobs = NULL;
|
||||
g_autoptr(GHashTable) blockJobs = NULL;
|
||||
|
||||
cmd = qemuMonitorJSONMakeCommand("query-block-jobs", NULL);
|
||||
if (!cmd)
|
||||
@ -5103,14 +5103,10 @@ qemuMonitorJSONGetAllBlockJobInfo(qemuMonitor *mon,
|
||||
}
|
||||
|
||||
cleanup:
|
||||
virJSONValueFree(cmd);
|
||||
virJSONValueFree(reply);
|
||||
return blockJobs;
|
||||
return g_steal_pointer(&blockJobs);
|
||||
|
||||
error:
|
||||
virHashFree(blockJobs);
|
||||
blockJobs = NULL;
|
||||
goto cleanup;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user