From 5c6b8226f33d408a7e4c482f2880bb2da10bc08c Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Wed, 25 Feb 2015 17:51:37 +0100 Subject: [PATCH] networkGetNetworkAddress: Drop empty 'error' label Moreover, there are two points within the function, where we're missing 'goto cleanup'. Fix this too. Signed-off-by: Michal Privoznik --- src/network/bridge_driver.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index eb42620cca..f3e093216f 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -4562,7 +4562,7 @@ networkGetNetworkAddress(const char *netname, char **netaddr) virReportError(VIR_ERR_NO_NETWORK, _("no network with matching name '%s'"), netname); - goto error; + goto cleanup; } netdef = network->def; @@ -4576,7 +4576,7 @@ networkGetNetworkAddress(const char *netname, char **netaddr) virReportError(VIR_ERR_INTERNAL_ERROR, _("network '%s' doesn't have an IPv4 address"), netdef->name); - break; + goto cleanup; } addrptr = &ipdef->address; break; @@ -4598,19 +4598,20 @@ networkGetNetworkAddress(const char *netname, char **netaddr) virReportError(VIR_ERR_INTERNAL_ERROR, _("network '%s' has no associated interface or bridge"), netdef->name); + goto cleanup; } break; } if (dev_name) { if (virNetDevGetIPv4Address(dev_name, &addr) < 0) - goto error; + goto cleanup; addrptr = &addr; } if (!(addrptr && (*netaddr = virSocketAddrFormat(addrptr)))) { - goto error; + goto cleanup; } ret = 0; @@ -4618,9 +4619,6 @@ networkGetNetworkAddress(const char *netname, char **netaddr) if (network) virNetworkObjUnlock(network); return ret; - - error: - goto cleanup; } /**