[PATCH 3/7] qemuBuildHostNetStr: remove unnecessary cleanup label

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 src/qemu/qemu_command.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 7c48a21c23..06ac184f0d 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3913,13 +3913,12 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
     VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
     virDomainNetType netType = virDomainNetGetActualType(net);
     size_t i;
-    char *ret = NULL;
 
     if (net->script && netType != VIR_DOMAIN_NET_TYPE_ETHERNET) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        _("scripts are not supported on interfaces of type %s"),
                        virDomainNetTypeToString(netType));
-        goto cleanup;
+        return NULL;
     }
 
     switch (netType) {
@@ -3983,7 +3982,7 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
             const char *prefix = "";
 
             if (!(addr = virSocketAddrFormat(&ip->address)))
-                goto cleanup;
+                return NULL;
 
             if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET))
                 prefix = "net=";
@@ -4039,11 +4038,9 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
 
     virBufferTrim(&buf, ",", -1);
     if (virBufferCheckError(&buf) < 0)
-        goto cleanup;
+        return NULL;
 
-    ret = virBufferContentAndReset(&buf);
- cleanup:
-    return ret;
+    return virBufferContentAndReset(&buf);
 }
 
 
-- 
2.19.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux