From f9b650a848631e2161822d2eab9a080174856b16 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Tomko?= Date: Mon, 26 Aug 2019 22:28:27 +0200 Subject: [PATCH] qemuBuildHostNetStr: remove unnecessary cleanup label MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Ján Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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); } -- 2.47.2