浏览代码

Merge pull request #5120 from magicwang-cn/master

etcdserver: close response body when getting cluster information
Xiang Li 9 年之前
父节点
当前提交
d16628bf50
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      etcdserver/cluster_util.go

+ 1 - 0
etcdserver/cluster_util.go

@@ -73,6 +73,7 @@ func getClusterFromRemotePeers(urls []string, timeout time.Duration, logerr bool
 			continue
 			continue
 		}
 		}
 		b, err := ioutil.ReadAll(resp.Body)
 		b, err := ioutil.ReadAll(resp.Body)
+		resp.Body.Close()
 		if err != nil {
 		if err != nil {
 			if logerr {
 			if logerr {
 				plog.Warningf("could not read the body of cluster response: %v", err)
 				plog.Warningf("could not read the body of cluster response: %v", err)