]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
openvz: Clean up openvzDomainGetHostname
authorJohn Ferlan <jferlan@redhat.com>
Fri, 30 Mar 2018 14:04:54 +0000 (10:04 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 16 Apr 2018 12:45:43 +0000 (08:45 -0400)
Remove the unnecessary goto error followed by goto cleanup
processing.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/openvz/openvz_driver.c

index 9900e8bab7c1d999994dbc6d6fa7884ba5c6a8ac..84eea56e1c7ca5537c07529d73348deecfc4634f 100644 (file)
@@ -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;
 }