提交 6d4163a0 编写于 作者: M Michal Privoznik

lxc: Don't return early in virLXCProcessSetupInterfaces

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: NMichal Privoznik <mprivozn@redhat.com>
上级 deb057fd
...@@ -544,7 +544,7 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn, ...@@ -544,7 +544,7 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn,
net = def->nets[i]; net = def->nets[i];
if (virLXCProcessValidateInterface(net) < 0) if (virLXCProcessValidateInterface(net) < 0)
return -1; goto cleanup;
if (virDomainNetAllocateActualDevice(def, net) < 0) if (virDomainNetAllocateActualDevice(def, net) < 0)
goto cleanup; goto cleanup;
...@@ -612,7 +612,7 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn, ...@@ -612,7 +612,7 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn,
/* Make sure all net definitions will have a name in the container */ /* Make sure all net definitions will have a name in the container */
if (!net->ifname_guest) { if (!net->ifname_guest) {
if (virAsprintf(&net->ifname_guest, "eth%zu", niface) < 0) if (virAsprintf(&net->ifname_guest, "eth%zu", niface) < 0)
return -1; goto cleanup;
niface++; niface++;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册