[libvirt PATCH 05/10] virSaveCookieParse: Cleanup

Tim Wiederhake twiederh at redhat.com
Mon Nov 8 12:17:35 UTC 2021


Remove unnecessary label and goto.

Signed-off-by: Tim Wiederhake <twiederh at redhat.com>
---
 src/conf/virsavecookie.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/conf/virsavecookie.c b/src/conf/virsavecookie.c
index 6cb7fafb1f..c24a292355 100644
--- a/src/conf/virsavecookie.c
+++ b/src/conf/virsavecookie.c
@@ -58,19 +58,14 @@ virSaveCookieParse(xmlXPathContextPtr ctxt,
                    virSaveCookieCallbacks *saveCookie)
 {
     VIR_XPATH_NODE_AUTORESTORE(ctxt)
-    int ret = -1;
 
     *obj = NULL;
 
     if (!(ctxt->node = virXPathNode("./cookie", ctxt))) {
-        ret = 0;
-        goto cleanup;
+        return 0;
     }
 
-    ret = virSaveCookieParseNode(ctxt, obj, saveCookie);
-
- cleanup:
-    return ret;
+    return virSaveCookieParseNode(ctxt, obj, saveCookie);
 }
 
 
-- 
2.31.1




More information about the libvir-list mailing list