There are two places in the loop body that just return instead of
jumping onto the cleanup label. The problem is the cleanup code
is not ran in those cases.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
net = def->nets[i];
if (virLXCProcessValidateInterface(net) < 0)
- return -1;
+ goto cleanup;
if (virDomainNetAllocateActualDevice(def, net) < 0)
goto cleanup;
/* Make sure all net definitions will have a name in the container */
if (!net->ifname_guest) {
if (virAsprintf(&net->ifname_guest, "eth%zu", niface) < 0)
- return -1;
+ goto cleanup;
niface++;
}
}