From bccebccc6493126d0b5dc6c8679e86c2d6f5dd1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Thu, 20 Dec 2018 19:50:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=BF=E5=85=8Dauzre=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E6=9C=AA=E9=87=8A=E6=94=BE=E6=96=87=E4=BB=B6=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/util/azure/azure.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/util/azure/azure.go b/pkg/util/azure/azure.go index 4fdd336c28..9c84677cbd 100644 --- a/pkg/util/azure/azure.go +++ b/pkg/util/azure/azure.go @@ -480,6 +480,7 @@ func waitForComplatetion(client *autorest.Client, req *http.Request, resp *http. if err != nil { return nil, err } + defer asyncResp.Body.Close() if asyncResp.StatusCode == 202 { if _location := asyncResp.Header.Get("Location"); len(_location) > 0 { location = _location @@ -571,6 +572,7 @@ func _jsonRequest(client *autorest.Client, method, domain, baseURL, body string) log.Errorf("Azure %s request: %s \nbody: %s error: %v", req.Method, req.URL.String(), body, err) return nil, err } + defer resp.Body.Close() if resp.StatusCode == 404 { data := []byte{}