[libvirt] [PATCH v1 19/26] vbox: remove unneeded labels

Daniel Henrique Barboza danielhb413 at gmail.com
Mon Jan 6 21:57:43 UTC 2020


Signed-off-by: Daniel Henrique Barboza <danielhb413 at gmail.com>
---
 src/vbox/vbox_MSCOMGlue.c     | 11 +++++------
 src/vbox/vbox_snapshot_conf.c |  9 +++------
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/vbox/vbox_MSCOMGlue.c b/src/vbox/vbox_MSCOMGlue.c
index 18a291a0d8..5cc3f5c7c8 100644
--- a/src/vbox/vbox_MSCOMGlue.c
+++ b/src/vbox/vbox_MSCOMGlue.c
@@ -357,24 +357,24 @@ vboxLookupRegistryValue(HKEY key, const char *keyName, const char *valueName)
     if (status != ERROR_SUCCESS) {
         VIR_ERROR(_("Could not query registry value '%s\\%s'"),
                   keyName, valueName);
-        goto cleanup;
+        return NULL;
     }
 
     if (type != REG_SZ) {
         VIR_ERROR(_("Registry value '%s\\%s' has unexpected type"),
                   keyName, valueName);
-        goto cleanup;
+        return NULL;
     }
 
     if (length < 2) {
         VIR_ERROR(_("Registry value '%s\\%s' is too short"),
                   keyName, valueName);
-        goto cleanup;
+        return NULL;
     }
 
     /* +1 for the null-terminator if it's missing */
     if (VIR_ALLOC_N(value, length + 1) < 0)
-        goto cleanup;
+        return NULL;
 
     status = RegQueryValueEx(key, valueName, NULL, NULL, (LPBYTE)value, &length);
 
@@ -382,13 +382,12 @@ vboxLookupRegistryValue(HKEY key, const char *keyName, const char *valueName)
         VIR_FREE(value);
         VIR_ERROR(_("Could not query registry value '%s\\%s'"),
                   keyName, valueName);
-        goto cleanup;
+        return NULL;
     }
 
     if (value[length - 1] != '\0')
         value[length] = '\0';
 
- cleanup:
     return value;
 }
 
diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c
index db6c389a64..4cd4e3a983 100644
--- a/src/vbox/vbox_snapshot_conf.c
+++ b/src/vbox/vbox_snapshot_conf.c
@@ -1228,23 +1228,20 @@ virVBoxSnapshotConfIsCurrentSnapshot(virVBoxSnapshotConfMachinePtr machine,
     if (machine == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("Machine is null"));
-        goto cleanup;
+        return 0;
     }
     if (snapshotName == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("snapshotName is null"));
-        goto cleanup;
+        return 0;
     }
     snapshot = virVBoxSnapshotConfSnapshotByName(machine->snapshot, snapshotName);
     if (snapshot == NULL) {
         virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT,
                        _("Unable to find the snapshot %s"), snapshotName);
-        goto cleanup;
+        return 0;
     }
     return STREQ(snapshot->uuid, machine->currentSnapshot);
-
- cleanup:
-    return 0;
 }
 
 /*
-- 
2.24.1





More information about the libvir-list mailing list