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.
This commit is contained in:
Michal Privoznik 2013-05-23 15:22:35 +02:00
parent 03d813bbcd
commit 4f3729f812

View File

@ -109,7 +109,7 @@ umlConnectTapDevice(virConnectPtr conn,
const char *bridge)
{
bool template_ifname = false;
int tapfd;
int tapfd = -1;
if (!net->ifname ||
STRPREFIX(net->ifname, VIR_NET_GENERATED_PREFIX) ||