Browse Source

Fix endpoint cnt decline overflow

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Lei Jitang 9 years ago
parent
commit
4999c5707d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      libnetwork/endpoint_cnt.go

+ 3 - 1
libnetwork/endpoint_cnt.go

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