From ee11ba29f59a8c3380093fe063e2f134ad67428f Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Fri, 30 Mar 2018 10:04:54 -0400 Subject: [PATCH] openvz: Clean up openvzDomainGetHostname MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the unnecessary goto error followed by goto cleanup processing. Signed-off-by: John Ferlan Reviewed-by: Ján Tomko --- 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 9900e8bab7..84eea56e1c 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; }