[libvirt PATCH 10/10] tools: use g_autoptr for virCgroup

Pavel Hrdina phrdina at redhat.com
Thu Oct 8 14:27:03 UTC 2020


Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 tools/virt-host-validate-common.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-common.c
index 4d8ec38f88..9779eb7b3b 100644
--- a/tools/virt-host-validate-common.c
+++ b/tools/virt-host-validate-common.c
@@ -289,7 +289,7 @@ int virHostValidateCGroupControllers(const char *hvname,
                                      int controllers,
                                      virHostValidateLevel level)
 {
-    virCgroupPtr group = NULL;
+    g_autoptr(virCgroup) group = NULL;
     int ret = 0;
     size_t i;
 
@@ -315,8 +315,6 @@ int virHostValidateCGroupControllers(const char *hvname,
         }
     }
 
-    virCgroupFree(group);
-
     return ret;
 }
 #else /*  !__linux__ */
-- 
2.26.2




More information about the libvir-list mailing list