[libvirt PATCHv2 11/16] qemu: agent: use g_auto in qemuAgentGetInterfaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
Reviewed-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>
---
 src/qemu/qemu_agent.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

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:
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux