Remove unnecessary label and goto.
Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/conf/network_event.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/conf/network_event.c b/src/conf/network_event.c
index a47bf4dd3e..6335cbf711 100644
--- a/src/conf/network_event.c
+++ b/src/conf/network_event.c
@@ -86,8 +86,8 @@ virNetworkEventDispatchDefaultFunc(virConnectPtr conn,
virConnectObjectEventGenericCallback cb,
void *cbopaque)
{
- virNetworkPtr net = virGetNetwork(conn, event->meta.name, event->meta.uuid);
- if (!net)
+ g_autoptr(virNetwork) net = NULL;
+ if (!(net = virGetNetwork(conn, event->meta.name, event->meta.uuid)))
return;
switch ((virNetworkEventID)event->eventID) {
@@ -100,16 +100,13 @@ virNetworkEventDispatchDefaultFunc(virConnectPtr conn,
networkLifecycleEvent->type,
networkLifecycleEvent->detail,
cbopaque);
- goto cleanup;
+ return;
}
case VIR_NETWORK_EVENT_ID_LAST:
break;
}
VIR_WARN("Unexpected event ID %d", event->eventID);
-
- cleanup:
- virObjectUnref(net);
}
--
2.31.1