From 406d56dc269748ff044de50d5a20172f3293a2fc Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 1 Dec 2008 20:24:46 +0000 Subject: [PATCH] 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 --- varnish-cache/bin/varnishd/cache_hash.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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 -- 2.39.5