From: phk Date: Tue, 1 Aug 2006 15:08:36 +0000 (+0000) Subject: Fixx off by one error. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63285d6aacad0700e74801a478e23535e02b7603;p=varnish Fixx off by one error. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@587 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- 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); }