浏览代码

Fix endpoint cnt decline overflow

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Lei Jitang 9 年之前
父节点
当前提交
4999c5707d
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      libnetwork/endpoint_cnt.go

+ 3 - 1
libnetwork/endpoint_cnt.go

@@ -143,7 +143,9 @@ retry:
 	if inc {
 	if inc {
 		ec.Count++
 		ec.Count++
 	} else {
 	} else {
-		ec.Count--
+		if ec.Count > 0 {
+			ec.Count--
+		}
 	}
 	}
 	ec.Unlock()
 	ec.Unlock()