From: Ján Tomko Date: Mon, 26 Aug 2019 20:28:27 +0000 (+0200) Subject: qemuBuildHostNetStr: remove unnecessary cleanup label X-Git-Tag: v5.8.0-rc1~158 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9b650a848631e2161822d2eab9a080174856b16;p=thirdparty%2Flibvirt.git qemuBuildHostNetStr: remove unnecessary cleanup label Signed-off-by: Ján Tomko Reviewed-by: Cole Robinson --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 811c7ead91..0874cfe165 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3916,13 +3916,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) { @@ -3989,7 +3988,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="; @@ -4046,11 +4045,9 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, virBufferTrim(&buf, ",", -1); if (virBufferCheckError(&buf) < 0) - goto cleanup; + return NULL; - ret = virBufferContentAndReset(&buf); - cleanup: - return ret; + return virBufferContentAndReset(&buf); }