Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
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