mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
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:
parent
03d813bbcd
commit
4f3729f812
@ -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) ||
|
||||
|
Loading…
Reference in New Issue
Block a user