提交 8766e9b5 编写于 作者: D Daniel P. Berrange

Avoid deleting NULL veth device name

If veth device allocation has a fatal error, the veths
array may contain NULL device names. Avoid calling the
virNetDevVethDelete function on such names.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 10caf94d
...@@ -1290,7 +1290,7 @@ cleanup: ...@@ -1290,7 +1290,7 @@ cleanup:
rc = -1; rc = -1;
} }
for (i = 0; i < nveths; i++) { for (i = 0; i < nveths; i++) {
if (rc != 0) if (rc != 0 && veths[i])
ignore_value(virNetDevVethDelete(veths[i])); ignore_value(virNetDevVethDelete(veths[i]));
VIR_FREE(veths[i]); VIR_FREE(veths[i]);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册