[libvirt PATCH 05/10] libvirt-lxc: use g_autoptr for virCgroup

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

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/libvirt-lxc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/libvirt-lxc.c b/src/libvirt-lxc.c
index 73daf123f0..f6391214be 100644
--- a/src/libvirt-lxc.c
+++ b/src/libvirt-lxc.c
@@ -289,7 +289,7 @@ int virDomainLxcEnterCGroup(virDomainPtr domain,
                             unsigned int flags)
 {
     virConnectPtr conn;
-    virCgroupPtr cgroup = NULL;
+    g_autoptr(virCgroup) cgroup = NULL;
 
     VIR_DOMAIN_DEBUG(domain, "flags=0x%x", flags);
 
@@ -307,12 +307,9 @@ int virDomainLxcEnterCGroup(virDomainPtr domain,
     if (virCgroupAddProcess(cgroup, getpid()) < 0)
         goto error;
 
-    virCgroupFree(cgroup);
-
     return 0;
 
  error:
     virDispatchError(NULL);
-    virCgroupFree(cgroup);
     return -1;
 }
-- 
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