qemu_monitor_json.c: modernize qemuMonitorJSONMigrateIncoming()

Use g_autoptr() and remove the now obsolete 'cleanup' label.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Daniel Henrique Barboza
2020-07-13 17:17:56 +02:00
committed by Michal Privoznik
parent b75ff9a194
commit d9ea60c0a0
+4 -10
View File
@@ -8405,9 +8405,8 @@ int
qemuMonitorJSONMigrateIncoming(qemuMonitorPtr mon, qemuMonitorJSONMigrateIncoming(qemuMonitorPtr mon,
const char *uri) const char *uri)
{ {
int ret = -1; g_autoptr(virJSONValue) cmd = NULL;
virJSONValuePtr cmd; g_autoptr(virJSONValue) reply = NULL;
virJSONValuePtr reply = NULL;
if (!(cmd = qemuMonitorJSONMakeCommand("migrate-incoming", if (!(cmd = qemuMonitorJSONMakeCommand("migrate-incoming",
"s:uri", uri, "s:uri", uri,
@@ -8415,14 +8414,9 @@ qemuMonitorJSONMigrateIncoming(qemuMonitorPtr mon,
return -1; return -1;
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
goto cleanup; return -1;
ret = qemuMonitorJSONCheckError(cmd, reply); return qemuMonitorJSONCheckError(cmd, reply);
cleanup:
virJSONValueFree(cmd);
virJSONValueFree(reply);
return ret;
} }