r1990 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Sun Sep 23 15:09:56 CEST 2007


Author: phk
Date: 2007-09-23 15:09:56 +0200 (Sun, 23 Sep 2007)
New Revision: 1990

Modified:
   trunk/varnish-cache/bin/varnishd/hash_classic.c
Log:
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.



Modified: trunk/varnish-cache/bin/varnishd/hash_classic.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/hash_classic.c	2007-09-23 13:09:38 UTC (rev 1989)
+++ trunk/varnish-cache/bin/varnishd/hash_classic.c	2007-09-23 13:09:56 UTC (rev 1990)
@@ -161,6 +161,10 @@
 			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) {




More information about the varnish-commit mailing list