From 63285d6aacad0700e74801a478e23535e02b7603 Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 1 Aug 2006 15:08:36 +0000 Subject: [PATCH] Fixx off by one error. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@587 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/hash_classic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/hash_classic.c b/varnish-cache/bin/varnishd/hash_classic.c index 32ebe67a..0b0f99c9 100644 --- a/varnish-cache/bin/varnishd/hash_classic.c +++ b/varnish-cache/bin/varnishd/hash_classic.c @@ -176,7 +176,8 @@ hcl_deref(struct objhead *oh) CAST_OBJ_NOTNULL(he, oh->hashpriv, HCL_ENTRY_MAGIC); mtx = he->mtx; AZ(pthread_mutex_lock(&hcl_mutex[mtx])); - if (--he->refcnt >= 0) { + assert(he->refcnt > 0); + if (--he->refcnt > 0) { AZ(pthread_mutex_unlock(&hcl_mutex[mtx])); return (1); } -- 2.39.5