提交 4f3729f8 编写于 作者: M Michal Privoznik

umlConnectTapDevice: initialize tapfd variable

There is possibility to jump to 'cleanup' label without tapfd variable
being initialized. In the label, VIR_FORCE_CLOSE(tapfd) is called which
can have fatal consequences.
上级 03d813bb
...@@ -109,7 +109,7 @@ umlConnectTapDevice(virConnectPtr conn, ...@@ -109,7 +109,7 @@ umlConnectTapDevice(virConnectPtr conn,
const char *bridge) const char *bridge)
{ {
bool template_ifname = false; bool template_ifname = false;
int tapfd; int tapfd = -1;
if (!net->ifname || if (!net->ifname ||
STRPREFIX(net->ifname, VIR_NET_GENERATED_PREFIX) || STRPREFIX(net->ifname, VIR_NET_GENERATED_PREFIX) ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册