mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-27 23:15:18 +00:00
lxc: fix a memory leak
In virLXCProcessSetupInterfaceTap, containerVeth needs to be freed on failure. Signed-off-by: Shi Lei <shi_lei@massclouds.com> Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
parent
87502a35ae
commit
ecfc2d5f43
@ -303,7 +303,7 @@ virLXCProcessSetupInterfaceTap(virDomainDefPtr vm,
|
|||||||
const char *brname)
|
const char *brname)
|
||||||
{
|
{
|
||||||
char *parentVeth;
|
char *parentVeth;
|
||||||
char *containerVeth = NULL;
|
g_autofree char *containerVeth = NULL;
|
||||||
const virNetDevVPortProfile *vport = virDomainNetGetActualVirtPortProfile(net);
|
const virNetDevVPortProfile *vport = virDomainNetGetActualVirtPortProfile(net);
|
||||||
|
|
||||||
VIR_DEBUG("calling vethCreate()");
|
VIR_DEBUG("calling vethCreate()");
|
||||||
@ -357,7 +357,7 @@ virLXCProcessSetupInterfaceTap(virDomainDefPtr vm,
|
|||||||
virDomainConfNWFilterInstantiate(vm->name, vm->uuid, net, false) < 0)
|
virDomainConfNWFilterInstantiate(vm->name, vm->uuid, net, false) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return containerVeth;
|
return g_steal_pointer(&containerVeth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user