From: Ján Tomko Date: Mon, 5 Oct 2020 20:04:34 +0000 (+0200) Subject: qemu: agent: use g_auto in qemuAgentGetInterfaces X-Git-Tag: v6.9.0-rc1~251 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00311ef6039c5075ae51133e253575755ad48c36;p=thirdparty%2Flibvirt.git qemu: agent: use g_auto in qemuAgentGetInterfaces Signed-off-by: Ján Tomko Reviewed-by: Jonathon Jongsma Reviewed-by: Neal Gompa --- diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index e7ea03f840..39c955fdf1 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -2216,12 +2216,12 @@ qemuAgentGetInterfaces(qemuAgentPtr agent, { int ret = -1; size_t i; - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; + g_autoptr(virJSONValue) cmd = NULL; + g_autoptr(virJSONValue) reply = NULL; virJSONValuePtr ret_array = NULL; size_t ifaces_count = 0; virDomainInterfacePtr *ifaces_ret = NULL; - virHashTablePtr ifaces_store = NULL; + g_autoptr(virHashTable) ifaces_store = NULL; /* Hash table to handle the interface alias */ ifaces_store = virHashNew(NULL); @@ -2250,9 +2250,6 @@ qemuAgentGetInterfaces(qemuAgentPtr agent, ret = ifaces_count; cleanup: - virJSONValueFree(cmd); - virJSONValueFree(reply); - virHashFree(ifaces_store); return ret; error: