Commit bbc3be6f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Part of this commit sneaked into the previous #1985:

Close a supposedly rare memory leak: when we loose the race to create
an objhead, we need to free the hash-string we created before our
second attempt.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1990 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 3c161283
......@@ -161,6 +161,10 @@ hcl_lookup(struct sess *sp, struct objhead *noh)
he->refcnt++;
roh = he->oh;
UNLOCK(&hp->mtx);
/*
* If we loose the race, we need to clean up
* the work we did for our second attempt.
*/
if (he2 != NULL)
free(he2);
if (noh->hash != NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment