Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx> Reviewed-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx> --- src/qemu/qemu_agent.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index 39c955fdf1..06e143b0b9 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -2214,7 +2214,6 @@ int qemuAgentGetInterfaces(qemuAgentPtr agent, virDomainInterfacePtr **ifaces) { - int ret = -1; size_t i; g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; @@ -2227,15 +2226,15 @@ qemuAgentGetInterfaces(qemuAgentPtr agent, ifaces_store = virHashNew(NULL); if (!(cmd = qemuAgentMakeCommand("guest-network-get-interfaces", NULL))) - goto cleanup; + return -1; if (qemuAgentCommand(agent, cmd, &reply, agent->timeout) < 0) - goto cleanup; + return -1; if (!(ret_array = virJSONValueObjectGetArray(reply, "return"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("qemu agent didn't return an array of interfaces")); - goto cleanup; + return -1; } for (i = 0; i < virJSONValueArraySize(ret_array); i++) { @@ -2247,10 +2246,7 @@ qemuAgentGetInterfaces(qemuAgentPtr agent, } *ifaces = g_steal_pointer(&ifaces_ret); - ret = ifaces_count; - - cleanup: - return ret; + return ifaces_count; error: if (ifaces_ret) { @@ -2258,7 +2254,7 @@ qemuAgentGetInterfaces(qemuAgentPtr agent, virDomainInterfaceFree(ifaces_ret[i]); } VIR_FREE(ifaces_ret); - goto cleanup; + return -1; } -- 2.26.2