From: phk Date: Mon, 1 Dec 2008 20:24:46 +0000 (+0000) Subject: We cannot gain a reference to an object unless it has an objhead, X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=406d56dc269748ff044de50d5a20172f3293a2fc;p=varnish We cannot gain a reference to an object unless it has an objhead, assert that we have one. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3448 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_hash.c b/varnish-cache/bin/varnishd/cache_hash.c index a6d66ab4..aae32892 100644 --- a/varnish-cache/bin/varnishd/cache_hash.c +++ b/varnish-cache/bin/varnishd/cache_hash.c @@ -427,14 +427,11 @@ HSH_Ref(struct object *o) CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC); oh = o->objhead; - if (oh != NULL) { - CHECK_OBJ(oh, OBJHEAD_MAGIC); - Lck_Lock(&oh->mtx); - } + CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC); + Lck_Lock(&oh->mtx); assert(o->refcnt > 0); o->refcnt++; - if (oh != NULL) - Lck_Unlock(&oh->mtx); + Lck_Unlock(&oh->mtx); } void