From: Michal Privoznik Date: Thu, 23 May 2013 13:22:35 +0000 (+0200) Subject: umlConnectTapDevice: initialize tapfd variable X-Git-Tag: v1.0.6-rc1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f3729f812d6746fe1dc6c4a5e474e65b9b9787e;p=thirdparty%2Flibvirt.git 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. --- diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c index a4088f2e6c..38dcfbb7df 100644 --- a/src/uml/uml_conf.c +++ b/src/uml/uml_conf.c @@ -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) ||