From: Martin Kletzander Date: Fri, 3 Jun 2016 11:26:30 +0000 (+0200) Subject: Fix building with -Og X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d02be4cf156149e992ef1712cfed5721d7c88a9;p=thirdparty%2Flibvirt.git Fix building with -Og When building using -Og, gcc sees that some variables can be used uninitialized It can be debatable whether it is possible with our codeflow, but functions should be self-contained and initializations are always good. The return instead of goto is due to actualType being used in the cleanup. Signed-off-by: Martin Kletzander (cherry picked from commit 3470cd860d517760b13e26d97b6a842ff72687a1) --- diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 1dfbde3330..d6eddd9137 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -4197,7 +4197,7 @@ lxcDomainAttachDeviceNetLive(virConnectPtr conn, if (!priv->initpid) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("Cannot attach disk until init PID is known")); - goto cleanup; + return -1; } /* preallocate new slot for device */ diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c index 423d069e1b..b7be2917e2 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -1570,7 +1570,7 @@ iptablesCreateRuleInstanceStateCtrl(virFirewallPtr fw, const char *ifname, virNWFilterVarCombIterPtr vars) { - int rc; + int rc = 0; bool directionIn = false; char chainPrefix[2]; bool maySkipICMP, inout = false; diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c index 9283aef173..4ca59f9d62 100644 --- a/src/util/virbitmap.c +++ b/src/util/virbitmap.c @@ -817,7 +817,7 @@ virBitmapLastSetBit(virBitmapPtr bitmap) ssize_t i; int unusedBits; ssize_t sz; - unsigned long bits; + unsigned long bits = 0; unusedBits = bitmap->map_len * VIR_BITMAP_BITS_PER_UNIT - bitmap->max_bit;