The 'enabled' bool is initialized to false, there is no need to nest the
conditions.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/vbox/vbox_common.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index 295f48376..1d38001f9 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -3822,20 +3822,19 @@ vboxDumpNetworks(virDomainDefPtr def, vboxDriverPtr data, IMachine
*machine, PRU
for (i = 0; netAdpIncCnt < def->nnets && i < networkAdapterCount;
i++) {
INetworkAdapter *adapter = NULL;
virDomainNetDefPtr net = def->nets[netAdpIncCnt];
+ PRBool enabled = PR_FALSE;
gVBoxAPI.UIMachine.GetNetworkAdapter(machine, i, &adapter);
- if (adapter) {
- PRBool enabled = PR_FALSE;
-
+ if (adapter)
gVBoxAPI.UINetworkAdapter.GetEnabled(adapter, &enabled);
- if (enabled) {
- vboxDumpNetwork(net, data, adapter);
- netAdpIncCnt++;
- }
+ if (enabled) {
+ vboxDumpNetwork(net, data, adapter);
- VBOX_RELEASE(adapter);
+ netAdpIncCnt++;
}
+
+ VBOX_RELEASE(adapter);
}
}
--
2.13.6