]> xenbits.xensource.com Git - libvirt.git/commitdiff
esx: eliminate unnecessary labels
authorLaine Stump <laine@redhat.com>
Fri, 3 Jul 2020 03:24:16 +0000 (23:24 -0400)
committerLaine Stump <laine@redhat.com>
Wed, 8 Jul 2020 20:36:09 +0000 (16:36 -0400)
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/esx/esx_vi.c

index d48a24e9d3f99c7d24f1f0c98122425a4a0ed196..71aa3876b3d6eca449891b147f4502819aa193a8 100644 (file)
@@ -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;