From e54bb482a195b19618b3dea8758a06cfe02cc08e Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Thu, 2 Jul 2020 23:24:16 -0400 Subject: [PATCH] esx: eliminate unnecessary labels MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Laine Stump Reviewed-by: Ján Tomko --- src/esx/esx_vi.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c index d48a24e9d3..71aa3876b3 100644 --- a/src/esx/esx_vi.c +++ b/src/esx/esx_vi.c @@ -369,7 +369,7 @@ int esxVI_CURL_Download(esxVI_CURL *curl, const char *url, char **content, unsigned long long offset, unsigned long long *length) { - char *range = NULL; + g_autofree char *range = NULL; g_auto(virBuffer) buffer = VIR_BUFFER_INITIALIZER; int responseCode = 0; @@ -405,12 +405,12 @@ esxVI_CURL_Download(esxVI_CURL *curl, const char *url, char **content, virMutexUnlock(&curl->lock); if (responseCode < 0) { - goto cleanup; + return -1; } else if (responseCode != 200 && responseCode != 206) { virReportError(VIR_ERR_INTERNAL_ERROR, _("HTTP response code %d for download from '%s'"), responseCode, url); - goto cleanup; + return -1; } if (length) @@ -418,9 +418,6 @@ esxVI_CURL_Download(esxVI_CURL *curl, const char *url, char **content, *content = virBufferContentAndReset(&buffer); - cleanup: - VIR_FREE(range); - if (!(*content)) return -1; -- 2.47.2