[libvirt PATCH 06/10] iptablesPrivateChainCreate: Use automatic memory management

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

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/util/viriptables.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/util/viriptables.c b/src/util/viriptables.c
index 198ece3d71..847af9b9d7 100644
--- a/src/util/viriptables.c
+++ b/src/util/viriptables.c
@@ -70,8 +70,8 @@ iptablesPrivateChainCreate(virFirewall *fw,
                            void *opaque)
 {
     iptablesGlobalChainData *data = opaque;
-    GHashTable *chains = virHashNew(NULL);
-    GHashTable *links = virHashNew(NULL);
+    g_autoptr(GHashTable) chains = virHashNew(NULL);
+    g_autoptr(GHashTable) links = virHashNew(NULL);
     const char *const *tmp;
     int ret = -1;
     size_t i;
@@ -114,8 +114,6 @@ iptablesPrivateChainCreate(virFirewall *fw,
 
     ret = 0;
  cleanup:
-    virHashFree(chains);
-    virHashFree(links);
     return ret;
 }
 
-- 
2.31.1




[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