[libvirt] [PATCH 2/2] openvz: Clean up openvzDomainGetHostname

John Ferlan jferlan at redhat.com
Wed Apr 11 16:57:08 UTC 2018


Remove the unnecessary goto error followed by goto cleanup
processing.

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/openvz/openvz_driver.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index ec9541840a..2c62dd6f29 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -319,22 +319,18 @@ openvzDomainGetHostname(virDomainPtr dom, unsigned int flags)
 
     hostname = openvzVEGetStringParam(dom, "hostname");
     if (hostname == NULL)
-        goto error;
+        goto cleanup;
 
     /* vzlist prints an unset hostname as '-' */
     if (STREQ(hostname, "-")) {
         virReportError(VIR_ERR_OPERATION_FAILED,
                        _("Hostname of '%s' is unset"), vm->def->name);
-        goto error;
+        VIR_FREE(hostname);
     }
 
  cleanup:
     virDomainObjEndAPI(&vm);
     return hostname;
-
- error:
-    VIR_FREE(hostname);
-    goto cleanup;
 }
 
 
-- 
2.13.6




More information about the libvir-list mailing list