From: John Ferlan Date: Fri, 30 Mar 2018 14:04:54 +0000 (-0400) Subject: openvz: Clean up openvzDomainGetHostname X-Git-Tag: v4.3.0-rc1~334 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee11ba29f59a8c3380093fe063e2f134ad67428f;p=thirdparty%2Flibvirt.git openvz: Clean up openvzDomainGetHostname Remove the unnecessary goto error followed by goto cleanup processing. Signed-off-by: John Ferlan Reviewed-by: Ján Tomko --- 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; }