]> err.no Git - varnish/commitdiff
We cannot gain a reference to an object unless it has an objhead,
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 1 Dec 2008 20:24:46 +0000 (20:24 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 1 Dec 2008 20:24:46 +0000 (20:24 +0000)
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

index a6d66ab46db03289f712b712908e94b657407493..aae328927b821517eed554faaf207ea04bcbefef 100644 (file)
@@ -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