]> err.no Git - varnish/commitdiff
Add a missing refcnt in the case where we lost a collision while
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 2 Mar 2009 16:15:58 +0000 (16:15 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 2 Mar 2009 16:15:58 +0000 (16:15 +0000)
doing the lockless lookup.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3858 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/hash_critbit.c

index 9273e8397be82b98a1fdfaa428c9d15d1d4a7b46..12c286ff2578ae0a95e70ae2cf07e03953950c72 100644 (file)
@@ -443,12 +443,14 @@ hcb_lookup(const struct sess *sp, struct objhead *noh)
                fprintf(stderr, "hcb_lookup %d\n", __LINE__);
 #endif
        } else {
+               CHECK_OBJ_NOTNULL(noh, OBJHEAD_MAGIC);
                free(noh->hash);
                noh->hash = NULL;
                VSL_stats->hcb_lock++;
 #ifdef PHK
                fprintf(stderr, "hcb_lookup %d\n", __LINE__);
 #endif
+               oh->refcnt++;
        }
        Lck_Unlock(&hcb_mtx);
        return (oh);