mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
libvirt-lxc: use g_autoptr for virCgroup
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
ca335643d6
commit
ab8cc94ccc
@ -289,7 +289,7 @@ int virDomainLxcEnterCGroup(virDomainPtr domain,
|
|||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
virConnectPtr conn;
|
virConnectPtr conn;
|
||||||
virCgroupPtr cgroup = NULL;
|
g_autoptr(virCgroup) cgroup = NULL;
|
||||||
|
|
||||||
VIR_DOMAIN_DEBUG(domain, "flags=0x%x", flags);
|
VIR_DOMAIN_DEBUG(domain, "flags=0x%x", flags);
|
||||||
|
|
||||||
@ -307,12 +307,9 @@ int virDomainLxcEnterCGroup(virDomainPtr domain,
|
|||||||
if (virCgroupAddProcess(cgroup, getpid()) < 0)
|
if (virCgroupAddProcess(cgroup, getpid()) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
virCgroupFree(cgroup);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virDispatchError(NULL);
|
virDispatchError(NULL);
|
||||||
virCgroupFree(cgroup);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user